• Stars
    star
    504
  • Rank 87,537 (Top 2 %)
  • Language SCSS
  • License
    Other
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ”ฎ Full RStudio IDE and Syntax Themes

{rsthemes}

rsthemes status badge

Installation

You can install rsthemes from my r-universe with:

install.packages(
  "rsthemes",
  repos = c(gadenbuie = 'https://gadenbuie.r-universe.dev', getOption("repos"))
)

Or you can install rsthemes from GitHub with:

# install.packages("devtools")
devtools::install_github("gadenbuie/rsthemes")

Then, install the included, hand-crafted themes with:

rsthemes::install_rsthemes()

or you can install the themes plus an additional set of base16-based themes with

rsthemes::install_rsthemes(include_base16 = TRUE)

Usage

The rsthemes package includes a couple helper functions for exploring the themes.

# list installed themes
rsthemes::list_rsthemes()

# Try all themes
rsthemes::try_rsthemes()

# Try just the light, dark, or base16 themes, e.g.
rsthemes::try_rsthemes("light")

Use rstudioapi::applyTheme() to activate a theme from the R console, or use Tools > Global Options > Appearance to interactively select a theme.

# Use a theme
rstudioapi::applyTheme("One Dark {rsthemes}")

Easy Theme Switching

rsthemes includes RStudio addins and functions toโ€ฆ

  • ๐ŸŒ… Toggle Dark Mode
    Switch between two preferred dark and light themes

  • ๐ŸŒƒ Auto Dark Mode
    Automatically choose a dark or light theme by time of day

  • โค๏ธ Favorite Themes
    Switch between a few of your favorite themes

  • ๐Ÿฅฑ Use Default RStudio Theme
    Switch back to RStudioโ€™s default theme

Choose Your Preferred Themes

First, set a default light and dark theme. For your current R sessions, you can use the Set Default Light Theme to Current addin (or the corresponding dark theme addin), or you can call the set_theme_light() or set_theme_dark() functions:

# Set current theme to default light or dark theme
rsthemes::set_theme_light()
rsthemes::set_theme_dark()

# Set a specific theme to default light or dark theme
rsthemes::set_theme_light("One Light {rsthemes}")
rsthemes::set_theme_dark("One Dark {rsthemes}")

To create a list of your favorite themes, you can use set_theme_favorite().

# Add current theme to your list of favorites
rsthemes::set_theme_favorite()

# Add a list of themes to your favorites
rsthemes::set_theme_favorite(
  c("GitHub {rsthemes}", "One Light {rsthemes}", "One Dark {rsthemes}")
)

These functions only save your preferences for the current R session. To set these defaults for all R sessions, add your preferences to your ~/.Rprofile. (You can use usethis::edit_r_profile() to quickly open your ~/.Rprofile for editing.)

# ~/.Rprofile
if (interactive()) {
  rsthemes::set_theme_light("GitHub {rsthemes}")
  rsthemes::set_theme_dark("Fairyfloss {rsthemes}")
  rsthemes::set_theme_favorite(
    c("GitHub {rsthemes}", 
      "One Light {rsthemes}", 
      "One Dark {rsthemes}")
  )
}

You can also set the following global options directly.

# ~/.Rprofile
options(
  rsthemes.theme_light = "Nord Snow Storm {rsthemes}",
  rsthemes.theme_dark = "Nord Polar Night Aurora {rsthemes}",
  rsthemes.theme_favorite = paste("One", c("Light", "Dark"), "{rsthemes}")
)

Toggle Your Favorite Themes

Use the Next Favorite Theme addin to walk through your list of favorite themes. Use the Modify Keyboard Shortcutsโ€ฆ dialog in the Tools menu of RStudio to create a keyboard shortcut to make it easy to quickly switch themes โ€” I use Ctrl+ Alt + N. You can also manually call use_theme_favorite() to use the next theme in the your favorites list.

Each time you run the addin, RStudio switches to the next theme in your favorites list. This is great if you have a few themes that you use in various contexts. For example, I have my personal favorite themes plus a few themes that work well during class or presentation sessions.

Automatic or Manual Light/Dark Mode

Use the Toggle Dark Mode addin to switch between your default light and dark themes. You can even set a keyboard shortcut in RStudio โ€” I used Ctrl + Alt + D โ€” to toggle dark mode.

You can also automatically choose the dark or light theme by time of day, using the included Auto Choose Dark or Light Theme addin, which requires that youโ€™ve set your preferred light/dark themes (see above).

If you would like to automatically choose the dark or light theme by time of day during each new session, you can call rsthemes::use_theme_auto() in your ~/.Rprofile. For best results, use the following template in your ~/.Rprofile to declare your preferred dark and light themes and to choose the correct style when your R session reloads.

if (interactive() && requireNamespace("rsthemes", quietly = TRUE)) {
  # Set preferred themes if not handled elsewhere..
  rsthemes::set_theme_light("One Light {rsthemes}")  # light theme
  rsthemes::set_theme_dark("One Dark {rsthemes}") # dark theme

  # Whenever the R session restarts inside RStudio...
  setHook("rstudio.sessionInit", function(isNewSession) {
    # Automatically choose the correct theme based on time of day
    rsthemes::use_theme_auto(dark_start = "18:00", dark_end = "6:00")
  }, action = "append")
}

Go Back to the Default

Sometimes when youโ€™re teaching or demonstrating RStudio features, youโ€™d like to have your IDE match the appearance of your learners, or at least the basic theme that everyone starts out with when they install RStudio for the first time.

Use the Use Default RStudio Theme to quickly switch back to RStudioโ€™s default theme, Textmate. Or, you can use rsthemes::use_default_rstudio_theme() to initiate the switch, perhaps from within the .Rprofile file of your teaching project.

Uninstall

If you want to uninstall all or some of the themes, you can use

rsthemes::remove_rsthemes()

# or just the base16 themes, e.g.
rsthemes::remove_rsthemes("base16")

Thanks and Theme Credits

Palettes


Please note that the โ€˜rsthemesโ€™ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

More Repositories

1

tidyexplain

๐Ÿคนโ€โ™€ Animations of tidyverse verbs using R, the tidyverse, and gganimate
R
758
star
2

regexplain

๐Ÿ” An RStudio addin slash regex utility belt
R
476
star
3

xaringanthemer

๐Ÿ˜Ž Give your xaringan slides some style
R
437
star
4

xaringanExtra

๐ŸŽก A playground of enhancements and extensions for xaringan slides.
JavaScript
433
star
5

ggpomological

๐Ÿ‘ Pomological plot theme for ggplot2
R
325
star
6

countdown

โฒ countdown timer for R Markdown slides and HTML docs
JavaScript
148
star
7

epoxy

Extra-strength glue engines for R Markdown and Quarto
R
146
star
8

cleanrmd

๐Ÿ“„โœจClean Class-Less R Markdown HTML Documents
CSS
128
star
9

tweet-conf-dash

A shiny twitter conference dashboard
CSS
121
star
10

shrtcts

Make Anything an RStudio Shortcut
R
103
star
11

ggweekly

๐Ÿ—“ ๐Ÿ–จ Easy, printable, custom calendars and week planners
R
101
star
12

tweetrmd

Embed Tweets in R Markdown
R
101
star
13

gentle-ggplot2

๐Ÿ“Š A Gentle Guide to the Grammar of Graphics with ggplot2
HTML
83
star
14

grkstyle

A Tidy R Code Style
R
81
star
15

metathis

โ„น๏ธ <meta> tags and social media cards for R-made web things
R
62
star
16

js4shiny

Companion Package for JavaScript for Shiny Users
R
53
star
17

mueller-report

The โ–ˆโ–ˆredacted Mueller Report
R
47
star
18

shinyComponents

๐Ÿ“โœจ Shiny Components in R Markdown
R
44
star
19

trump-tweet-time

๐ŸŽฎ An 8-bit Trump tweet guessing game for your "executive time"
R
36
star
20

starwarsdb

Relational Data from the Star Wars API for Learning and Teaching
R
35
star
21

covid19-florida

Florida COVID19 Data parsed from Florida DOH Dashboard and PDF reports
HTML
32
star
22

rsconf_tweets

rstudio::conf 2018 tweet explorer and FOMO reducer
R
30
star
23

status

HTML
29
star
24

ermoji

๐Ÿคทโ€โ™‚๏ธ RStudio Addin to Search and Copy Emoji
R
26
star
25

lorem

Generate Lorem Ipsum Text
R
26
star
26

shinyThings

Reusable Shiny Modules and Other Shiny Things
R
25
star
27

trug-ggplot2

๐Ÿ“Š Slides for presentation on ggplot2 at Tampa R Users Meetup (Jan 2018)
R
23
star
28

yule-rstudio

โ›„๏ธ๐ŸŽ„๐Ÿ–ฅ A Holiday Theme for RStudio
22
star
29

snippets

My snippets for RStudio (or elsewhere)
Vim Snippet
21
star
30

slides

HTML
20
star
31

tiktokrmd

Embed TikTok Videos in R Markdown
R
18
star
32

xaringan-logo

xaringan template with logo on all slides
HTML
17
star
33

tweets-of-the-year

R
16
star
34

xaringan2powerpoint

a snarky powerpoint from xaringan demo
HTML
16
star
35

drake-intro

Reproducible Data Workflows with Drake
R
14
star
36

getcitations

R script to extract pandoc citations from markdown text and create local .bib file from a master BibTeX library.
R
14
star
37

applause

๐Ÿ‘ Zero-Configuration Applause/Claps/Kudos Button for R Markdown and Shiny apps
R
14
star
38

tidyjs-r

Tidy Data with JavaScript and tidy.js
R
14
star
39

sprinkles

Utility CSS and JavaScript for R Markdown
JavaScript
14
star
40

rstudio-global-2021-calendar

Build your talk calendar for rstudio::global(2021)
R
13
star
41

garrickadenbuie-com

My personal website
HTML
13
star
42

intro-to-git-for-scientists

Intro to git for scientists and other regular people
TeX
12
star
43

de-iris-my-repos

It's time to move on from iris
R
12
star
44

repromonkey

๐Ÿ’ A Reproducibility Chaos Monkey
R
12
star
45

oceanic-eighties

๐Ÿ‘จโ€๐ŸŽค Oceanic Eighties Theme for RStudio
11
star
46

js4shiny-frappeCharts

Building an HTML Widget, a demonstration
HTML
11
star
47

synamyn

Synonyms! An RStudio addin interface for ropenscilabs/syn
R
10
star
48

gathertweet

Commandline utility for quick {rtweet} tweet gathering
R
9
star
49

r-colors-css

A utility CSS stylesheet with R's color names
HTML
8
star
50

rsprefs

Manage and Sync Your RStudio Preferences
R
8
star
51

js4shiny-drumkit

HTML
8
star
52

branchMover

An RStudio Addin to Help Move the Default Branch of Your GitHub Repos
R
8
star
53

rstudio-ide-tips-demo

Companion to rstudio-ide-tips
R
7
star
54

gadenbuie

7
star
55

mctestanalysis

๐Ÿ“š Apps and reports for multiple-choice test analysis in R with Shiny
R
6
star
56

rstudio-ide-tips

Slides for RStudio IDE Tips
JavaScript
6
star
57

rstudioAddinFriend

RStudio addin to help you build RStudio addins
R
5
star
58

drake-rstudio-jobs-example

R
5
star
59

extra-awesome-xaringan

R
4
star
60

pagedown-cheatsheet

JavaScript
4
star
61

docker-rstudio-keras

๐Ÿณ RStudio + tidyverse + keras (cpu)
Dockerfile
4
star
62

positron-plus-1-e

A Positron extension pack for dev and data science.
4
star
63

rstatsnyc-2018-tweets

Tweets from #rstatsnyc -- remix of rsconf tweet shiny app
R
3
star
64

ten-thousand-functions

Ten Thousand Reasons to Love Functions
CSS
3
star
65

msglooker

A Shiny App to View And Export Outlook Messages
R
3
star
66

crantrack

Hourly snapshots of CRAN's incoming packages folder
R
3
star
67

fwiffer

๐Ÿ“โœจ Fixed width file definitions made easy
R
3
star
68

xaringan-club

A place to talk about xaringan
HTML
3
star
69

js4shiny-workshop-webpage

HTML
3
star
70

rstudioconf-notes

HTML
2
star
71

rocker-verse-metaflow

rocker/verse + {metaflow}
Dockerfile
2
star
72

nonlinear-opt-notes

Class notes for Nonlinear Optimization and Game Theory at USF, Spring 2016
2
star
73

rstats-tweets

R
2
star
74

alix

Warn About Accessibility Issues in HTML Documents and Apps
R
2
star
75

quarto-partials

Partial content templates for Quarto
Lua
1
star
76

resume

HTML
1
star
77

podcasts

R-based podcast catcher
R
1
star
78

ms-render-ui-delay

R
1
star
79

aws-p2-setup

My AWS EC2 p2 instance setup with nvidia-docker
Shell
1
star
80

usf-boot-camp-R

Slides and materials for R sessions at USF Code & Data Boot Camp 2014
R
1
star
81

xaringan-line-focus

HTML
1
star
82

rmedicine-2024-bslib

Next Generation Shiny Apps with bslib
R
1
star
83

revealjs-text-resizer

Resize text on quarto slides
HTML
1
star
84

quarto-reprex-listing-chomp

EJS
1
star
85

docker-shinycannon

Dockerfile
1
star
86

speedDate

Quick Date Format Strings for strftime
R
1
star
87

quarto-tachyons

Tachyons Utility CSS for Quarto
CSS
1
star