[R] saving results under specified file name

Nitin Jain nj7w at yahoo.com
Sun Sep 23 15:09:05 CEST 2007


Hello,

I would like to save the results in a specified file name.  Here is a test example:
 

aa <- function(xx, newname) {
 yy <- xx^2
    rdName <- file.path(paste(newname, ".RData", sep = ""))
    assign(eval(newname), yy)
save(newname, file=rdName) ## FIXME
}


aa(3, "test")

load("test.RData")
ls() 

I would like to see test (which should store 9) rather than newname (which stores "test")

Please let me know how to do this.

Thanks.
-Nitin



      _________________________________________________________________________________
stings, and more!
http://tv.yahoo.com/collections/3658



More information about the R-help mailing list