[R] call object from character?

Peter Langfelder peter.langfelder at gmail.com
Thu Apr 19 05:06:57 CEST 2012


On Wed, Apr 18, 2012 at 7:25 PM, chuck.01 <CharlieTheBrown77 at gmail.com> wrote:
> Let say I have an object (I hope my terminology is correct) a
> a <- 12
>> a
> [1] 12
>
> And "a" has been assigned the number 12, or whatever
> And lets say I have a character "call_A"
> call_A <- "a"
>>call_A
> [1] "a"
>
> What is the function "F" that allows this to happen:
>> F( call_A )
> [1] 12


Use get:

> a = 12
> get("a")
[1] 12

HTH,

Peter



More information about the R-help mailing list