[R] Using a string as a variable name

Jason Horn jason at 109valentine.com
Sat Oct 21 01:28:02 CEST 2006


Is it possible to use a string as a variable name?  For example:

foo<="var1"
frame$foo   # frame is a data frame with with a column titled "var1"

This does not work, unfortunately.  Am I just missing the correct  
syntax to make this work?


- Jason



More information about the R-help mailing list