[R] simple question about variables....

Stéphane Cruveiller scruveil at genoscope.cns.fr
Thu Jul 13 09:53:32 CEST 2006


Dear R users,

I have a simple question on variable manipulation.
Imagine I have an object "OBJ" that has "toto" as one of its variables.
I would like to understand why if I do

 > varname <- "toto"

 >OBJ$varname                             returns no results

whereas

 > OBJ[varname]                            returns the column entitled 
"toto"


Thanks for your help.

Stéphane.



More information about the R-help mailing list