[R] using a variable name stored in another variable?

Sharpie chuck at sharpsteen.net
Sun Feb 7 23:13:25 CET 2010



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...

Hope this helps!

-Charlie
-- 
View this message in context: http://n4.nabble.com/using-a-variable-name-stored-in-another-variable-tp1472371p1472400.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list