PDA

View Full Version : How do I use workspace in R?



firemonkey
12-05-2020, 10:33 PM
I saved the workspace. Then went to use it a few hours later. The previous data wasn't there. I know you have to type ls in to get the previous data
.
I tried ls() and got > ls()
[1] "aggr_pops" "batch_def" "check_formats" "check_omit"
[5] "cycles_def" "getMonte" "headStrings" "nameIsFree"

davit
12-05-2020, 10:37 PM
There should be a .RData file in your working directory. Use the load command to load it.

I think this is a bad practice though. Is what you are working on that big that you can't rerun a script?

altvred
12-06-2020, 11:46 AM
The .Rdata file by default is saved to your current working directory, so try searching the last folder you used in R.
If you just used the default working directory set in R, try looking there.
Just open up R and use the getwd() command If you don't know the default directory.

But I do agree that it's a counterproductive habit. You're better off just starting a new session every time and rerunning the scripts.

Amerismed
12-16-2020, 10:11 AM
I agree that you are better off starting a new session.