[R] saving a 'get' object in R

David Stevens david.stevens at usu.edu
Tue Jun 24 22:35:30 CEST 2014

R community,

Apologies if this has been answered. The concept I'm looking for is to 
save() an object retrieved using get() for an object
that resulted from using assign. Something like


where assign(foo,obj) creates an object named foo with the contents of 
obj assigned. For example, if

x <- data.frame(v1=c(1,2,3,4),v2=c('1','2','3','4'))
foo = 'my.x'
# (... then modify foo as needed)

# though this generates " in save(get(foo), file = paste(foo, ".rData", 
sep = "")) :
object ‘get(foo)’ not found", whereas


at the command prompt yields the contents of my.x

There's a concept I'm missing here. Can anyone help?


David Stevens

David K Stevens, P.E., Ph.D.
Professor and Head, Environmental Engineering
Civil and Environmental Engineering
Utah Water Research Laboratory
8200 Old Main Hill
Logan, UT  84322-8200
435 797 3229 - voice
435 797 1363 - fax
david.stevens at usu.edu

More information about the R-help mailing list