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

From: Petr Pikal <petr.pikal_at_precheza.cz>
Date: Mon 12 Jun 2006 - 17:25:29 EST


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@yahoo.com.br>
To:             	r-help@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@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@precheza.cz



R-help@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 Received on Mon Jun 12 17:29:03 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 12 Jun 2006 - 18:11:12 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.