Site icon Roel Peters

Solving RStudio’s long startup time

You might have noticed that the startup speed of RStudio varies. But how can you fix RStudio when its loading time is really, really long? In this blog post I elaborate on the problem and how you can solve it.

Everytime you close RStudio while working on your projects, RStudio will ask if you want to save the workspace image to an .RData file. The workspace contains quite a lot of elements:

However, if you decide to save your workspace to an .RData file, you could run into startup problems later. If you’re working with a lot of data, and you have data frames of multiple gigabytes, starting RStudio can take minutes.

Here’s what you can do to prevent it.

A couple of years ago I couldn’t even open R, because it was trying to open my last project, and it had a huge .RData file. So there’s no way you can change the setting in the RStudio Global Options menu. However, there are a couple of things you can do to start RStudio and change the setting.

The RStudio configuration file can be found in:

~/.rstudio-desktop/monitored/user-settings/user-settings 

Translating this to Windows:

C:\Users\<username>\AppData\Local\RStudio-Desktop\monitored\user-settings

The setting you should change is LoadRData. You should set it to “0”.

loadRData="0"

By the way, if you’re having trouble understanding some of the code and concepts, I can highly recommend “An Introduction to Statistical Learning: with Applications in R”, which is the must-have data science bible. If you simply need an introduction into R, and less into the Data Science part, I can absolutely recommend this book by Richard Cotton. Hope it helps!

Exit mobile version