Re: [R] how to indice the column in the data.frame

2011-11-15 Thread David Winsemius
On Nov 15, 2011, at 11:02 AM, haohao Tsing wrote: hi R,users Now I read a data from a txt file newdata<-read.table("1.txt") in the 1.txt ,there are several column shown as below 1 3 4 5 2 3 5 6 4 5 6 7 so when I want analysis the second column anadata<-newdata$V2 but my question I can not use

Re: [R] how to indice the column in the data.frame

2011-11-15 Thread Sarah Goslee
On Tue, Nov 15, 2011 at 11:23 AM, Joshua Wiley wrote: > Hi, > > Look at ?"[" > > anadata <- newdata[, cmn] > ## i.e., extract all rows (the first argument is empty of the 2 column > anadata <- newdata[, 2] Or, if this is part of a more general problem and the column names are not necessarily in s

Re: [R] how to indice the column in the data.frame

2011-11-15 Thread Joshua Wiley
Hi, Look at ?"[" anadata <- newdata[, cmn] ## i.e., extract all rows (the first argument is empty of the 2 column anadata <- newdata[, 2] Hope this helps, Josh On Tue, Nov 15, 2011 at 8:02 AM, haohao Tsing wrote: > hi R,users >  Now I read a data from a txt file > newdata<-read.table("1.txt")

[R] how to indice the column in the data.frame

2011-11-15 Thread haohao Tsing
hi R,users Now I read a data from a txt file newdata<-read.table("1.txt") in the 1.txt ,there are several column shown as below 1 3 4 5 2 3 5 6 4 5 6 7 so when I want analysis the second column anadata<-newdata$V2 but my question I can not use some certain variable to indice the column? e.g cmn=2