[R] using several columns from a Table in a procedure

Petr Pikal petr.pikal at precheza.cz
Mon Jun 12 09:25:29 CEST 2006


Hi

not sure what you want but if you just would  like to filter numeric 
columns

file[,sapply(file, is.numeric)]

HTH
Petr


On 10 Jun 2006 at 22:26, Milton Cezar wrote:

Date sent:      	Sat, 10 Jun 2006 22:26:35 -0300 (ART)
From:           	Milton Cezar <miltinho_astronauta at yahoo.com.br>
To:             	r-help at stat.math.ethz.ch
Subject:        	[R] using several columns from a Table in a procedure

> Dear R-friends
> 
>   I have a table with more than 50 columns (variables). Many of them
>   are numeric and others are of type char. I would like repeat a group
>   of command using only a set of the numeric variables, excluding
>   others (for example V8, V12 etc) and not using the char ones. As a
>   sample I want:
> 
>   ----
>       x11() 
>       plot (X, v2)
>       model_v2<-glm (v2~X)
>       lines (X, predict(model_v2))
> 
>       x11()
>       plot (X, v3)
>       model_v3<-glm (v3~X)
>       lines (X, predict(model_v3))
> 
>       x11()
>       plot (X, v4)
>       model_v4<-glm (v4~X)
>       lines (X, predict(model_v4))
>       ....
>   -----
> 
>   Look that I even use de X variable agains the other ones. How can I
>   do that? Another question is how can I change the name of a column
>   in a table?
> 
>   Thanks A Lot
> 
>   Miltinho
> 
> 
> 
>  __________________________________________________
> 
> 
>  [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal at precheza.cz



More information about the R-help mailing list