[R] How to save and restore a workspace
macqueen1 at llnl.gov
Wed Oct 25 23:04:46 CEST 2017
Saving your workspace means that the variables you currently have defined in your session [ everything that shows up when you type ls() ] are saved to a file, by default named “.RData”. To restore the workspace, you use the “Load Workspace” command and navigate to the (same) .RData file. Its default location for Windows, as far as I know, is your “Documents” folder. So look there.
I see that you tried the Load Workspace command, and didn’t get what you were looking for. I just tested what I described above, and it did work. So either you didn’t navigate to and open .RData, or you have some other idea about what saving and loading a workspace means. Hopefully, it’s the former!
With some effort, you can learn to save different .RData files for different projects; for that see the R Windows FAQ.
By the way, this is much easier on Linux, and on Mac when working in a Terminal (command line) environment.
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
Lab cell 925-724-7509
On 10/23/17, 3:45 PM, "R-help on behalf of Jim Lemon" <r-help-bounces at r-project.org on behalf of drjimlemon at gmail.com> wrote:
Saving your workspace doesn't mean that everything will be rerun when
you start a new R session. I just means that persistent objects like
data frames will be there. If you type:
you will see all of those things that were there when you ended in the
last session. Things like commands will be in the "history", so you
can retrieve them just as you did at the end of the last session (up
arrow). It may be a better solution if you save sequences of commands
as R script files (e.g. "something.R") as you can run them:
and edit and save them again.
On Tue, Oct 24, 2017 at 9:12 AM, <jonnvan at gmail.com> wrote:
> I recently downloaded R in hopes of learning to use it for statistics.
> I have promptly run into a problem, as I am unable to save, and later recover, a workspace so I can resume work where I left off.
> I am using Windows.
> I indicate "yes" to the pop up after q(). Then when I later reopen R Console and click on File, I cannot get my prior workspace to appear in the R Console frame so I can resume work.
> In the File drop down menu I have tried Load Workspace, Load History, Display file(s)..., opened R Type: R Workspace with no luck.
> I have read about this in two different books, the R Manual, and R FAQs, used the RGui help function, and still cannot do it.
> I have used Windows for years, but I am ignorant about programming.
> Would appreciate any help you might offer.
> I live in the Denver area, so if there are any local resources you could direct me to, I would be grateful for that as well.
> Thank you,
> Jon VanDeventer
> Sent from my iPad
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help