Recover Data From R CMD BATCH

Is there a way to restore workspace after using R CDM BATCH?

Say I have a file example.R:

data = rnorm(10)

and I run:

R CMD BATCH example.R &

Is there any way to access dataafter the operation is completed?

+4
source share
1 answer

A file with the name .RDatamust be created in the directory in which you run the command. When R starts from this directory, the workspace should load at startup. Alternatively, you can manually reload the workspace.

R .RData 

or, within R:

load('.RData')

, , ?save.image R script:

save.image(file="filename.RData")
+5

All Articles