aljabadi
aljabadi

Reputation: 543

custom RStudio exit strategy for a given project

In RStudio you can configure whether or not to save the .RData file on exit. I generally do not like to save the R project's .RData file on exit so I have set that option accordingly in Preferences > General > Basic: Workspace (on Mac). I do however would like to save it for some specific projects. I was wondering if I can specify that in .Rproj.user or somewhere. I understand that I can save the objects and reload them, but that's suboptimal for my usage.

Upvotes: 0

Views: 136

Answers (1)

JBGruber
JBGruber

Reputation: 12420

You can just open a .Rproj with a text editor. It looks like this:

Version: 1.0

RestoreWorkspace: Yes
SaveWorkspace: Yes
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

I changed the values for RestoreWorkspace and SaveWorkspace to accomplish what you want. Documentation on this is a bit spotty, to say the least, but the values which are in there by default are self-explanatory.

Upvotes: 1

Related Questions