[R] using a variable name stored in another variable?
Thomas Lumley
tlumley at u.washington.edu
Mon Feb 8 17:09:07 CET 2010
On Sun, 7 Feb 2010, Sharpie wrote:
>
>
> Chris Seidel wrote:
>>
>> Hello,
>>
>> I'm trying to figure out how to create a data object, and then save it
>> with a user-defined name that is input as a command line argument. I
>> know how to create the object and assign it the new name, however, I
>> can't figure out how to refer to the new name for a future operation
>> such as save().
>>
>> ..snip..
>>
>>
>
> You probably want the get() function:
>
> get( myobjectname )
>
> The help page for get() has a note which states that it is the compliment of
> assign(). Perhaps a similar note should be added to the help page for
> assign...
It's also FAQ 7.21. Not quite as famous as 7.31, but still a good vintage.
-thomas
Thomas Lumley Assoc. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle
More information about the R-help
mailing list