# load all themes
rstudio_themes <- read.csv("data-raw/rstudio_themes.csv")

# sort alphabetically by theme name
rstudio_themes <- rstudio_themes[order(rstudio_themes$theme_name),]

# save outputs: CSV incl. header, CSV excl. header, RData file

write.csv(rstudio_themes,
          file = "data-raw/rstudio_themes.csv",
          row.names = FALSE)

save(rstudio_themes, file = "data/rstudio_themes.rda")

RStudio Theme Collection

This is a collection of custom RStudio themes that offer alternatives to the default built-in themes. Below, you will find a list with r nrow(rstudio_themes) RStudio themes that have been created by users (r sum(rstudio_themes$is_dark) dark themes, r nrow(rstudio_themes) - sum(rstudio_themes$is_dark) light themes).

You can find here a CSV file, also including links to screenshots if available.

If you would like to learn more about how to create custom themes for RStudio, please see the RStudio theme creation website. There is also a great tutorial by Xiaoyang Song that explains the structure of theme files, usage of variables and other topics.

To add your own theme to the list, please open a pull request, add your theme to the file data-raw/rstudio_themes.csv and re-knit the file README.rmd.

# check for duplicated theme names

if (any(duplicated(rstudio_themes$theme_name))) {
  warning("Duplicated Theme Names!\n")
  cat(rstudio_themes$theme_name[duplicated(rstudio_themes$theme_name)])
}

# check for duplicated Github Direct Links

if (any(duplicated(rstudio_themes$github_direct_link))) {
  warning("Duplicated Github Direct Links!\n")
  cat(rstudio_themes$github_direct_link[duplicated(rstudio_themes$github_direct_link)])
}

# check for duplicated screenshot URLs

if (any(duplicated(rstudio_themes$screenshot) & rstudio_themes$screenshot > 1)) {
  warning("Duplicated screenshots!\n")
  cat(rstudio_themes$screenshot[duplicated(rstudio_themes$screenshot)])
}

How to install/use custom themes

RStudio supports custom themes in version 1.20 or higher. Themes can be installed via "Tools" - "Global Options" - "Appearance" - "Add Theme". Once a theme is installed, the theme name will appear in the theme list and it can be activated by simply clicking on it.

Add Theme option in RStudio Global Preferences Menu

The "rstudioapi" package includes an "addTheme" function that allows to install custom themes.

Moreover, this Github repository comes with a little pseudo-package that allows to install specific themes from the list below, also coming with the possibility for a bulk install. Below is a quick overview how to use this function.

    # install the pseudo-package from this Github repository
    devtools::install_github("max-alletsee/rstudio-themes")

    library(rstudiothemes) # ... then load the library

    # example 1: bulk-install all light themes
    install_rstudio_themes(theme = "all_light")

    # example 2: install two specific light themes
    install_rstudio_themes(theme = c("Ayu Light", "Github {rsthemes}"))

Dark Themes from R Users

# filter on dark themes
themes_dark <- rstudio_themes[rstudio_themes$is_dark, ]


for (row in 1:nrow(themes_dark)) {
  # base text
  text <- paste0("* ", themes_dark$theme_name[row], " ([repo](", themes_dark$github_repository[row], "), [direct link](", themes_dark$github_direct_link[row], "))")

  # additional text if screenshot is available
  if(themes_dark$screenshot[row] != "") {
    text <- gsub(pattern = "))",
                 replacement = paste0("), [screenshot](", themes_dark$screenshot[row], "))"),
                 x = text)
  }

  # additional text if description is available
  if(nchar(themes_dark$description[row]) > 1) {
    text <- paste0(text, ": ", themes_dark$description[row])
  }

  cat(paste(text, "\n"))
}

Light Themes from R Users

# filter on dark themes
themes_light <- rstudio_themes[!rstudio_themes$is_dark, ]


for (row in 1:nrow(themes_light)) {
  # base text
  text <- paste0("* ", themes_light$theme_name[row], " ([repo](", themes_light$github_repository[row], "), [direct link](", themes_light$github_direct_link[row], "))")

  # additional text if screenshot is available
  if(themes_light$screenshot[row] != "") {
    text <- gsub(pattern = "))",
                 replacement = paste0("), [screenshot](", themes_light$screenshot[row], "))"),
                 x = text)
  }

  # additional text if description is available
  if(nchar(themes_light$description[row]) > 1) {
    text <- paste0(text, ": ", themes_light$description[row])
  }

  cat(paste(text, "\n"))
}

Built-in RStudio Themes

The list below shows the full list of the currently built-in RStudio themes that are installed by default.

Dark

Light



max-alletsee/rstudio-themes documentation built on July 4, 2024, 9:07 p.m.