Reset RStudio to use predefined set of settings/preferences. Correctly works only with RStudio 1.3 or newer. Recommended to use with RStudio 2022.07.1 or newer.
Details
Posit's Custom Settings guide documents the point-and-click interface for user preferences, preference files, and configuration directories.
See also
get_path_rstudio_config_file()
Session User Settings
lists settings accepted by rstudioapi::writeRStudioPreference().
On Resetting RStudio Desktop's State.
For a broader interface to preference files and addin shortcuts, see the rstudio.prefs package by S.A. van der Wulp and Daniel D. Sjoberg.
Examples
if (interactive()) {
rstudio_reset_user_settings(to = "rstudio-default")
rstudio_reset_user_settings(to = "bio-default")
rstudio_reset_user_settings(to = "bio-dark-blue")
rstudio_reset_user_settings(to = "bio-black")
}