Skip to content
Prev 257771 / 398502 Next

Parametrized object name in Save statement

John -
    When you have a character string, and you want the R object whose
name is contained in that character string, the easiest way to get 
the object is to use the get() function.  So

save(get(paste("cart_",args, sep ="")), file = file)

would probably do what you want.

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu
On Fri, 22 Apr 2011, John Dennison wrote: