[R] Full Documentation of R analysis

Joshua Wiley jwiley.psych at gmail.com
Thu Apr 4 16:25:17 CEST 2013


Hi Will,

I think that save.image() is the way to go.  Regarding the directory,
its possible to pass arguments to an R script from the command line,
or as long as the R script is in the directory you want the image
saved in, just save it to the current working directory.

Cheers,

Josh


On Thu, Apr 4, 2013 at 7:18 AM,  <will.eagle at 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.
>
>    Best regards and thanks in advance,
>
>    Will
> ______________________________________________
> R-help at 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.



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://joshuawiley.com/
Senior Analyst - Elkhart Group Ltd.
http://elkhartgroup.com



More information about the R-help mailing list