[R] Accessing a field in a data fram

From: R_Learner <sschiang8_at_gmail.com>
Date: Wed, 02 Jul 2008 12:10:37 -0700 (PDT)

raw <- read.csv(file=filename, head=TRUE,sep=",")

I've read in a csv file, and I'm looking to access a column whose name is held in a string.

For example, I want to access raw$one or raw$two, but this will depending on the string. Let's say that the string is decision<-"one". How would I access raw$one?

The following doesn't work:

Please help me!

View this message in context: http://www.nabble.com/Accessing-a-field-in-a-data-fram-tp18244661p18244661.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 02 Jul 2008 - 20:59:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 02 Jul 2008 - 22:31:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive