[R] referencing values of strings

Arne Henningsen ahenningsen at email.uni-kiel.de
Wed Nov 17 17:52:22 CET 2004


"get" is your friend:

R> x <- c( 1, 2, 3 )
R> get( "x" )
[1] 1 2 3

All the best,
Arne

On Wednesday 17 November 2004 16:48, Apoian, Zack wrote:
> Say you have a vector named x and a function which returns the character
> string "x" .  How would I take "x" as an input and return the vector x?
>
>
> DISCLAIMER: This e-mail message and any attachments are inte...{{dropped}}
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

-- 
Arne Henningsen
Department of Agricultural Economics
University of Kiel
Olshausenstr. 40
D-24098 Kiel (Germany)
Tel: +49-431-880 4445
Fax: +49-431-880 1397
ahenningsen at agric-econ.uni-kiel.de
http://www.uni-kiel.de/agrarpol/ahenningsen/




More information about the R-help mailing list