[R] Use a text variable's value to specify another varaible?

From: Ben Fairbank <BEN_at_ssanet.com>
Date: Fri 26 Jan 2007 - 15:48:07 GMT

Greetings guRus --  

If a variable, e.g., 'varname', is a character string, e.g. varname <- "datavector", and I want to apply a function, such as table(), to datavector, what syntax or method will do so using only the variable varname? This seems similar to indirect addressing, but I have not seen a method for it in the R manuals. Is there a general name for such indirect reference that one might search for?  

(This came up while writing a function that takes the value of 'varname' from the keyboard and then applies functions to it.)  

With thanks for any solution,  

Ben Fairbank  

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list

Archive generated by hypermail 2.1.8, at Fri 26 Jan 2007 - 17:30:29 GMT.
