When I submit more than one batch file (same programs, different parameter values, huge simulations, different result names) the only results that get saved are from the *last* batch file to finish. They are all being run in the same subdirectory (so same .RData file?) I've done: R --save BATCH infile outfile and I've also put q(save="yes") at the end of the program, but it will still only save results from one program. Is there any way to get all the results to save without putting each of the batch files in a separate directory? Thanks, Jo Johanna Hardin Department of Mathematics & Computer Science Pomona College (909) 607-8717 jo.hardin@pomona.edu [[alternative HTML version deleted]]
?save is your friend. Write out dataobjects with different filenames. Johanna Hardin <Jo.Hardin at pomona.edu> writes:> When I submit more than one batch file (same programs, different parameter > values, huge simulations, different result names) the only results that get > saved are from the *last* batch file to finish. They are all being run in > the same subdirectory (so same .RData file?) > > I've done: > > R --save BATCH infile outfile > > and I've also put > > q(save="yes") > > at the end of the program, but it will still only save results from one > program. Is there any way to get all the results to save without putting > each of the batch files in a separate directory? > > Thanks, Jo > > Johanna Hardin > Department of Mathematics & Computer Science > Pomona College > (909) 607-8717 > jo.hardin at pomona.edu > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >-- A.J. Rossini / rossini at u.washington.edu / rossini at scharp.org http://software.biostat.washington.edu/ UNTIL IT MOVES IN JULY. Biomedical and Health Informatics, University of Washington Biostatistics, HVTN/SCHARP, Fred Hutchinson Cancer Research Center. FHCRC: 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}
You can use save(object1, file="lalala.1"), save(object1, file="lalala.2"), ... and the use load() to restore the object1 and object2. Or if you have many objects in a simulation to save, you can save all objects using save.image("sim1.result.R"). Another option is to use write.table or zz <- file("lalal1.txt"); cat( ... , file=zz) etc if you want a human-readable form of your output. It would be a good idea to use the compress=TRUE option in save() and R --no-save. -----Original Message----- From: Johanna Hardin [mailto:Jo.Hardin at pomona.edu] Sent: Thursday, July 03, 2003 2:24 AM To: 'r-help at lists.R-project.org' Subject: [R] Batch files in R When I submit more than one batch file (same programs, different parameter values, huge simulations, different result names) the only results that get saved are from the *last* batch file to finish. They are all being run in the same subdirectory (so same .RData file?) I've done: R --save BATCH infile outfile and I've also put q(save="yes") at the end of the program, but it will still only save results from one program. Is there any way to get all the results to save without putting each of the batch files in a separate directory? Thanks, Jo Johanna Hardin Department of Mathematics & Computer Science Pomona College (909) 607-8717 jo.hardin at pomona.edu [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help