3

Is there a way to set the Rstudio Theme info in .Rprofile file?

I see lots of references on how to change the editor theme using the Rstudio IDE. https://support.rstudio.com/hc/en-us/articles/115011846747-Using-RStudio-Themes and this SO responce: Altering RStudio Editor Theme

I would really like to port my preference as part of my .Rprofile file to each new projects as I work on them or as part of a container build.

The current theme values can be viewed using the function getThemeInfo() from rstudioapi, but have no idea how to set the theme or the $editor, $global, and $dark theme parts of the theme info.

> rstudioapi::getThemeInfo()
$editor
[1] "Merbivore"

$global
[1] "Modern"

$dark
[1] TRUE
nick
  • 1,090
  • 1
  • 11
  • 24
schalls
  • 46
  • 1
  • 4

1 Answers1

0

You can use rstudioapi::applyTheme(theme_name)

So applying Dracula theme include the following in your .rprofile:

rstudioapi::applyTheme("Dracula")

user63230
  • 4,095
  • 21
  • 43