Skip to content
Prev 274530 / 398506 Next

Turning Data Frame Columns into Vectors

You access columns of a data.frame by column indices as in: X[ ,1], X[ ,2],
etc. The index before the comma would stand for the row if you wanted to
restrict those. The index after the comma captures the column.

That said, you typically would not "extract" rows from the data frame but
draw directly from the data frame for an analysis contingent on the factors
in column 1. You may want to look at the tapply() function, in particular. 

HTH,
Daniel
jawbonemurphy wrote:
--
View this message in context: http://r.789695.n4.nabble.com/Turning-Data-Frame-Columns-into-Vectors-tp3908157p3908298.html
Sent from the R help mailing list archive at Nabble.com.