nateroe
nateroe

Reputation: 547

How to access R session/global environment after running script through Rscript on Linux

I am using a Linux Workstation to run my R script. I did so using screen and then Rscript myRscript.R. Is there anyway to access the R session after the script has run? I want to be able to write new commands and access the global environment that was created during that session.

I tried asking the Unix community, but no response... https://unix.stackexchange.com/questions/608073/how-to-pass-code-to-attached-screen

Upvotes: 0

Views: 424

Answers (1)

Daniel R
Daniel R

Reputation: 2042

The session is lost after the script is done running. But you can save the environment using save.image("env_file.Rdata") and use it later using load("env_file.Rdata").

See http://ugrad.stat.ubc.ca/R/library/base/html/save.html

Upvotes: 2

Related Questions