Nolwenn LeMeur <[EMAIL PROTECTED]> writes: > George Papayiannis wrote: > > >Hi everyone, > > > >I have a table with 10 columns and many rows. > >I want to select the 3rd,4th and 10th column. > > > >If I wanted to select the 3rd and 4th it would be no > >problem. > > > >q3[ ,(3:4)] > > > >but how do I select the 10th along with it? > >
> Try > subset(q3, select=c(3,4,10)) Yes, but q3[,c(3:4,10)] works too. Notice that the index can be an arbitrary numeric vector. -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
