loadIntoList <- function(filename) { e <- new.env() load(filename, envir = e) mget(ls(e), envir = e) }
-roger
Achim Zeileis wrote:
On Tue, 20 Apr 2004 15:39:07 +0200 Tamas Papp wrote:
I have the following problem.
Use the same algorithm (with different parameters) to generate simulation results. I store these in variables, eg A, B, C, which I save into a file with
save(A, B, C, file="solution001.Rdata")
I do this many times. Then I would like to load the above, but in such a manner that A, B, C woule be part of a list, eg
sol001 <- loadIntoList("solution001.Rdata")
so that sol001 is a list with elements A, B, C.
I am looking for a way to implement the above function.
If your objects are always called A, B, and C, the following should work:
loadIntoList <- function(file) { load(file) return(list(A = A, B = B, C = C)) }
hth, Z
The variables are very large and I need a lot of time to compute them, so saving & loading the results is the only viable alternative.
Thanks,
Tamas
-- Tamás K. Papp E-mail: [EMAIL PROTECTED] Please try to send only (latin-2) plain text, not HTML or other garbage.
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html