Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RStudio global settings (options) Export/Import

I would like to export/import RStudio global options, which can typically found and set in RStudio at Tools> Global Options...

Ideally I could run a line of code, saving the existing settings to a file. Then run another line of code to load those settings from this file.

These options include settings such as a Dark Theme for the GUI, or Tab Width etc.

This has a range of uses but my specific use case is that I spin up virtual environments to utilize cloud computing. Each time I shutdown and/or spin-up a new environment I need to apply these various settings anew (or work with the defaults).

After searching for a while all I have found is this unanswered user request. Despite the unanswered request, I feel like there is/should be an existing way to do this, even if imperfect.

Thanks in advance for any help/direction

like image 749
Dave Avatar asked Jun 07 '18 22:06

Dave


People also ask

Where can I find a full list of RStudio settings?

A full list of RStudio’s settings, along with their data types, allowable values, etc., can be found in the Session User Settings section of the RStudio Server Professional Administration Guide. If you’re an administrator of an RStudio Server, you can establish defaults for any setting by using a global set of user preferences, placed here:

When to set environment variables in RStudio?

The environment variable must be set before you try to weave the document. RStudio will pass the -file-line-error (or -c-style-errors for MikTeX) option to indicate that it wants errors formatted with C style file and line information.

How do I update R‑studio?

You may specify some global setting for R‑Studio on the Settings dialog box. You may reach it by selecting Settings on the Tools menu. If this box is selected, R‑Studio will automatically check for updates.

What languages can be installed in RStudio?

Main dictionary language — RStudio's default installation includes English dictionaries for the US, UK, Canada, and Australia. In addition, dictionaries for 28 other languages can be installed.


1 Answers

Aha! I found a relevant support page: https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State

TL;DR:
Most settings are stored in a "RStudio-Desktop" folder. To be exact:

  • Windows: %localappdata%\RStudio-Desktop
    (fyi: %localappdata% usually resolves to C:\Users\{username}\AppData\Local [1])
  • Unix / MacOS: ~/.rstudio-desktop

I have confirmed that deleting/overriding that folder with a backup of it restores the settings from the time of the backup.

Some further information (e.g. last window size) may be stored at

  • Windows: %appdata%\RStudio
  • Unix: ~/.config/RStudio
    (I'm guessing it's the same for MacOS, but the relevant section is worded it bit weirdly, so I'm unsure.)
like image 96
Niki Herl Avatar answered Oct 13 '22 01:10

Niki Herl