Re: [R] Selecting columns of a table (not consecutive)

From: Nolwenn LeMeur <nlemeur_at_fhcrc.org>
Date: Mon 03 Oct 2005 - 08:29:56 EST

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?
>
>Thanks for your help,
>George
>
>p.s Please respond if you know, assignment is due
>tomorrow...
>
>Thanks again..
>
>______________________________________________
>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
>
>
Hi George,

Try
 subset(q3, select=c(3,4,10))

Nolwenn



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 Oct 03 08:32:47 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:34 EST