Resetting RStudio

In this page:



Overview

As you work in RStudio, occasionally you might need to reset RStudio's state. This is useful if, for example, your RStudio cache is corrupted and you can't start an RStudio instance.

RStudio and R store users' session information in several directories. Renaming those directories will reset the state of RStudio and often let you start RStudio again. The table below lists the directories and information stored by them. It is often sufficient to rename only the first 2 directories in the table (~/.rstudio and ~/.local/share/rstudio) in order to fix RStudio's corrupted cache.

Location of the directoriesInformation stored
~/.rstudio

All user settings, open files and tabs, as well as active and suspended sessions.

This folder was automatically created if you have used RStudio version 1.3 or older in the past. In IDAS, that corresponds to R version 3.6.1.

~/.local/share/rstudio

All open files and tabs, as well as active and suspended sessions.

This folder was automatically created if you have used RStudio version 1.4 or later. In IDAS, that corresponds to R versions 4.0.2 and later.

~/.config/rstudio

All user settings (Global Options).

This folder was automatically created if you have used RStudio version 1.4 or later. In IDAS, that corresponds to R versions 4.0.2 and later.

.RData (can be in various folders, depending on where you saved your .RData files in the past)R data and objects
.Rhistory (can be in various folders, depending on the location where you started RStudio in the past)R command history


Resetting RStudio

1. Log in to IDAS from https://idas.uiowa.edu/

2. Start a Terminal session in IDAS. There are 2 ways to do this:

    a) Option 1: From RStudio interface in IDAS: Click the "Terminal" tab, which is next to the "Console" tab in RStudio.

    

    b) Option 2: From Jupyter Hub interface in IDAS: This is helpful if you can't get to the RStudio interface.

        - Go to (fill in your HawkID) - https://idas.uiowa.edu/research/user/HAWKID/lab

        - Select Terminal from the Other section to start a bash session:

  

3. In Terminal, use the "mv" Linux command to rename the necessary directories: 

    mv ~/.rstudio ~/.rstudio-old

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

4. Follow the steps here to restart your IDAS server. 

5. If RStudio still doesn't spawn, repeat steps 1 - 4, this time also renaming the following directories:

    mv ~/.config/rstudio ~/.config/rstudio-old

    mv .RData .RData-old

    mv .Rhistory .Rhistory-old

Note that .RData and .Rhistory might be in various locations, depending on where you saved your R data and where you started RStudio from in the past.

6. By renaming those directories, we created a backup of the RStudio's session information in case you need to revert to those "old" versions. Since those directories can be large and take up space, when you are sure that you no longer need the old versions, you can simply delete them.

Contact

If you have any questions or comments, please contact research-computing@uiowa.edu.