This function updates the RStudio preferences saved in the rstudio-prefs.json file. A full listing of preferences that may be modified are listed here https://docs.rstudio.com/ide/server-pro/session-user-settings.html

use_rstudio_prefs(..., .write_json = TRUE, .backup = TRUE)

Arguments

...

series of RStudio preferences to update, e.g. always_save_history = FALSE, rainbow_parentheses = TRUE

.write_json

logical indicating whether to update and overwrite the existing JSON file of options. Default is TRUE. When FALSE, the function will return a list of all options, instead of writing them to file.

.backup

logical indicating whether to create a back-up of preferences file before it's updated. Default is TRUE

Value

NULL, updates RStudio rstudio-prefs.json file

Author

Daniel D. Sjoberg

Examples

if (FALSE) { # interactive()
# pass preferences individually --------------
use_rstudio_prefs(
  always_save_history = FALSE,
  rainbow_parentheses = TRUE
)

# pass a list of preferences -----------------
pref_list <-
  list(always_save_history = FALSE,
       rainbow_parentheses = TRUE)

use_rstudio_prefs(!!!pref_list)
}