customise your R experience

Would you like RStudio to show you a random The Good Place quote, spoken by a ASCII animal along with some random message of praise/encouragement each time you start a coding session or restart R?

Of course you would!!!

how to customise your .rprofile

You will need to install the following packages:

  • usethis
  • goodshirt
  • cowsay
  • praise

Use usethis to open your .rprofile file

usethis::edit_r_profile()

Copy and paste this text into your .rprofile, save and close the file, then restart R.

#start with a quote from The Good Place (requires goodshirt package) 
#spoken by a random ASCII animal (requires cowsay package)

if (interactive() && require("goodshirt", 
  quietly = TRUE)) {
  goodshirt::soul_squad()
  cowsay::say(as.character(soul_squad()),
              by = "random",
              what_color = crayon::blue$bold,
              by_color = crayon::blue$bold)
  
# then get some random praise to get you started for the day (requires the praise package) 
  
  message("\nHappy Coding Jen!", "💜")
  message(praise::praise())

}

The result….

knitr::include_graphics("message.png")

Thanks to Dani Navarro and Charles Grey for the inspiration!

Change your RStudio theme

How do you get your windows to be navy and text to be pink you ask? You can customise your R Studio theme by selecting…

Tools…Global Options…Appearance

My favourite of the default options (the navy background with pink text) is called Cobalt.

knitr::include_graphics("colbalt.png")

But Cobalt is not the cutest option! There was twitter frenzy last weekend about cuteness in #rstats coding …

… and thanks to the amazing Garrick Aden-Buie with these 3 lines of code, you too can have a fairy-floss themed RStudio experience

devtools::install_github("gadenbuie/rsthemes@fairyfloss")

rsthemes::install_rsthemes()

rstudioapi::applyTheme("Fairyfloss {rsthemes}")
knitr::include_graphics("fairy.png")

via GIPHY