[R] how can I attach a variable stored in

Peter Waltman waltman at cs.nyu.edu
Thu Sep 20 19:31:59 CEST 2007


Hi -

Any help would be greatly appreciated.

I'm loading a list variable that's stored in an .RData file and would 
like attach it.

I've used attach( <file_name> ), but that only lets me see the variable 
that's stored in the file. 

As the variable name is of the form "comp.x.x", I've tried using attach( 
ls( pat="comp" ) ), but get an error as ls() just gives back a string.

I've also played around with eval(), but don't really quite get what 
that function does since it seems to get into the R internals which I 
don't entirely understand and I haven't found any great unified 
documentation on R's handling environment and scoping.

Thanks,

Peter Waltman



More information about the R-help mailing list