How to Prevent Objects from Automatically Loading When I Open Rstudio

How to prevent objects from automatically loading when I open Rstudio

Tools -> Global options -> Restore .RData into workspace at startup (?)

How can I stop a package from loading on startup in Rstudio

So this is what I did to solve the problem:

Everything below is at the directory which containes the *.RProj file.

First, I 'hid' the .RData file by running this in the terminal.

mv .RData ./.RData_old

Next, I ran this in an R session (not Rstudio):

remove.packages('XLConnect', 'XLConnectJars')

Then I closed the R session and opened the Rstudio project to make sure it would open fine without the RData file.

After that I got my RData file back

mv .RData_old ./.RData

Finally I opened the project file again and presto!

It complains about packages not installed but at least I know which packages are required. Moreover, my data and results aren't lost.

R Studio - data in Global Environment automatically loads on startup - how to remove

It told you the filename. Just delete that file, i.e. ~/.RData.

And you can set the default in RStudio not to restore the workspace: it's in Tools | Global options | General | Restore .RData into workspace at startup. There's another option to say not to store it.



Related Topics



Leave a reply



Submit