On 04/04/2013 10:18 AM, will.ea...@gmx.net wrote:
    Dear all,

    I would like to fully document an analysis in R including script, output and
    workspace data. To do this I currently run under Linux

    $ R CMD BATCH myscript.R

    This command combines and saves only the script commands and the output
    ./myscript.Rout. To save the workspace, I have to explicitly specify the
    path in the R file and apply save.image(...).

    How can I save the full workspace with the same naming scheme under the same
    path, e.g. ./myscript.RData similar to ./myscript.Rout?

    Note: R CMD BATCH myscript.R --save does not work.


By default, R CMD BATCH runs R with --save, so it will save the image in the usual default place.

You can use commandArgs() in your script to find the name of the script, and construct a save image filename from that if you want to save somewhere else.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to