Skip to content
Prev 309377 / 398506 Next

help - extract data using column names

A look at the tutorial might help here, but anyway:

Say you have that dataframe down there with the name myData (you should use dput() to give us the data btw),

then you can subset that by using myData[rows,columns], where left of the comma you define which rows you want, and right of the comma is which columns you want. If you leave it blank, all will be selected.

So you want all rows from the columns, which names are in aa, then you would write

myData[ , aa]
On 30.10.2012, at 15:09, alex_123 wrote: