[R] Re: referencing values of strings

Douglas Bates bates at stat.wisc.edu
Wed Nov 17 18:32:21 CET 2004


Vito Ricci wrote:
> Hi,
> 
> see ? as.numeric
> 
> as.numeric(c("-.1"," 2.7 ","-1.5"))
> [1] -0.1  2.7 -1.5
> 
> you 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?

I think the question might have been about obtaining the value of the 
symbol "x", in which case the answer is

get("x")




More information about the R-help mailing list