Resetting RStudio Desktop's State

Follow

Overview

RStudio Desktop stores its internal state in a hidden directory. If this directory does not exist, RStudio will create it on start up. This directory includes information about open documents, log files, and other state information. Removing (or renaming) this directory will reset RStudio's state. 

We recommend renaming this directory to create a backup version instead of completely deleting it. This allows you to save your settings, in case you want to revert back to them. Additionally, if you experienced a crash or RStudio failed to start, this directory may contain vital information for determining the source of the error. In this case, we recommend renaming this directory and sending it along if asked by RStudio Support.

Starting with RStudio 1.3, user preferences are stored in a separate folder from internal state. This lets you perform a state reset without losing your settings, and also allows for preferences to be sync'ed between machines (in e.g., AppData/Roaming on Windows) while internal state is machine specific. 

Some versions of RStudio Desktop store additional preferences (such as the size and location of the window and the rendering mode) in a separate location. To fully reset state, this must also be deleted or renamed, as described below in "Resetting Other Preferences".

If you are using RStudio Projects, we'd also recommend resetting the project-specific state if you're having issues - you can do this by navigating to the Project's folder in your file browser, and renaming the .Rproj.user directory there.

Accessing the RStudio-Desktop Directory (Internal State)

Windows

You can open an Explorer window into the RStudio-Desktop directory by typing the following command into Start -> Run:

%localappdata%\RStudio

For older versions of RStudio (v1.3 and older), the state is stored here:

%localappdata%\RStudio-Desktop

You can then rename this directory and send it with your support request.

Mac OS X

You can easily create a backup by running the following command from the terminal. Then you can send this backup with your support request:

mv ~/.local/share/rstudio ~/.local/share/rstudio-backup

Alternatively, you can open a Finder window into the rstudio directory by typing the following command at the Terminal:

open ~/.local/share/rstudio

In RStudio 1.3 and prior, the folder ~/.rstudio-desktop is used instead of ~/.local/share/rstudio.

Linux

You can easily create a backup by running the following command from the terminal. Then you can send this backup with your support request:

mv ~/.local/share/rstudio ~/.local/share/rstudio-backup

Alternatively, you can open a File Browser into the rstudio directory by typing the following command at the Terminal:

nautilus ~/.local/share/rstudio

In RStudio 1.3 and prior, the folder ~/.rstudio-desktop is used instead of ~/.local/share/rstudio.

Resetting Other Preferences

Windows

You can open an Explorer window into the RStudio preferences directory by typing the following command into Start -> Run:

For Windows 7, 8 and 10:

%appdata%\RStudio

You can then rename this directory to backup-rstudio and send it with your support request.

Mac OS X

To create a backup, run the following command from the terminal. You can then include the file ~/backup-rstudio-prefs with your support request:

defaults read com.rstudio.desktop > ~/backup-rstudio-prefs

To delete these settings, run the following command from the terminal. Use caution; this cannot be undone unless you have created the backup file, and deleting anything other than com.rstudio.desktop could create serious problems with your system.

defaults delete com.rstudio.desktop

Linux

You can easily create a backup by running the following command from the terminal. Then you can send this backup with your support request:

mv ~/.config/RStudio ~/backup-RStudio

Alternatively, you can open a File Browser into the RStudio preferences directory by typing the following command at the Terminal:

nautilus ~/.config/RStudio

 

Accessing the RStudio Configuration Directory (Preferences)

Windows

On Windows, the preferences folder can be found here:

%appdata%\RStudio

Most problems do not require clearing preferences to resolve, but you will need to rename or remove this folder if you wish to perform a full factory reset. 

Mac OS X and Linux

On Unix-based operating systems, the configuration directory can be found here: 

~/.config/rstudio

 

Resetting Other Preferences

Windows

You can open an Explorer window into the RStudio preferences directory by typing the following command into Start -> Run:

For Windows 7, 8 and 10:

%appdata%\RStudio

You can then rename this directory to backup-rstudio and send it with your support request.

Mac OS X

To create a backup, run the following command from the terminal. You can then include the file ~/backup-rstudio-prefs with your support request:

defaults read com.rstudio.desktop > ~/backup-rstudio-prefs

To delete these settings, run the following command from the terminal. Use caution; this cannot be undone unless you have created the backup file, and deleting anything other than com.rstudio.desktop could create serious problems with your system.

defaults delete com.rstudio.desktop

Linux

You can easily create a backup by running the following command from the terminal. Then you can send this backup with your support request:

mv ~/.config/RStudio ~/backup-RStudio

Alternatively, you can open a File Browser into the RStudio preferences directory by typing the following command at the Terminal:

nautilus ~/.config/RStudio

 

Return to Troubleshooting Guide: Using RStudio

Comments