Retrieving Workspace in R
I am working with开发者_开发问答 R on Ubuntu. When I was working I accidentally hit Ctrl-Z and it kicked me out of the workspace and I did not save my variables. Is there anyway to retrieve my old workspace?
Thank you.
Jump back into the still-running session via
fg
i.e. bring the R session you suspended via Ctrl-Z
back to the foreground.
Reconnect and try "jobs" from the terminal to see if the R process is still there. If so, fg
should do the trick as @Dirk said (if you have more than 1 suspended jobs, fg %2
would bring back the second one etc).
As far as I know, if you actually terminate the R session and did not save your workspace, it is lost - sorry. S-PLUS would save all variables in your workspace directory as you generated them, but R keeps everything in memory until you explicitly save your workspace - typically at exit, but save.image()
can do it mid-session.
/Tommy
精彩评论