Skip to content
Prev 198779 / 398506 Next

save an object by dynamicly created name

Hi,

I would like to save a few dynamically created objects to disk. The
following is the basic flow of the code segment

for(i = 1:10) {
   m = i:5
   save(m, file = ...) ## ???
}
To distinguish different objects to be saved, I would like to save m as m1,
m2, m3 ..., to file /home/data/m1, /home/data/m2, home/data/m3, ...

I tried a couple of methods on translating between object names and strings
(below) but couldn't get it to work. 
https://stat.ethz.ch/pipermail/r-help/2008-November/178965.html
http://tolstoy.newcastle.edu.au/R/help/04/08/2673.html

Any suggestions would be appreciated.

thanks

Hao