Desktop Survival Guide
by Graham Williams

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 subset.

Copyright © Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
The PDF version is a formatted comprehensive draft book (with over 800 pages).
Brought to you by Togaware. This page generated: Sunday, 22 August 2010