Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

Accessing Columns

When accessing a column name of a data frame with the $ notation you can directly use the column name. Using the [ notation you will need to quote the name.



> people[,"Age"]
> people$Age
> people[["Age"]]
> subset(people, select=Age)

This also illustrates a use of XnullXR functionsR functions (R function)R functionsR libraries (R library)R functionsR option (R option)R functionsR packages (R package)R functionsDatasets (Dataset)R functionsR functionssubset.



Copyright © 2004-2008 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
PDF version is properly formatted and forms a comprehensive book (draft with over 600 pages).
Brought to you by Togaware.