R
Learning R
I highly recommend subscribing to the R Weekly newsletter. This e-mail is sent every Monday and is full of helpful tutorials about how to do stuff with R.
Searching for help with R on Google can sometimes be tricky because the program name is a single letter. Google is generally smart enough to figure out what you mean when you search for “r scatterplot”, but if it does struggle, try searching for “rstats” instead (e.g. “rstats scatterplot”). Also, since most of your R work in this class will deal with the tidyverse family of packages, it’s often easier to just search for that instead of the letter “R” (e.g. “tidy pivoting”).
If you use Twitter, post R-related questions and content with #rstats. The community there is exceptionally generous and helpful. Also check out StackOverflow (a Q&A site with hundreds of thousands of answers to all sorts of programming questions) and RStudio Community (a forum specifically designed for people using RStudio and the tidyverse (i.e. you)).
These resources are also really really helpful:
- CSE 631: Principles & Practice of Data Visualization: Yet another introductory course for R and
ggplot2
by Dr. Alison Presmanes Hill at RStudio. - A Complete Guide to
scales
: This absolutely gem of a site is partially interactive and dedicated to thescales
family of functions that are used inggplot2
where you can learn what each does, when to use it, and all corresponding options available. - LHS 610: Exploratory Data Analysis for Health: A comprehensive way to learn R using health based data sets by Dr. Karandeep Singh out of the University of Michigan.
- R for Data Science: A free online book for learning the basics of R and the tidyverse.
- R and RStudio cheat sheets: A large collection of simple cheat sheets for RStudio,
ggplot2
, and other R-related things. - RStudio Conference cheat sheets: A comprehensive collection of all recognized RStudio cheat sheets from rstudio::conf 2019. Also check out the conference workshop materials to see in depth walkthroughs.
- Stat 545: Dr. Jenny Bryan at RStudio has an entire introductory course in R, visualization, and data analysis online.
- STA 112FS: Data Science: Dr. Mine Çetinkaya-Rundel at the University of Edinburgh / Duke University has an entire introductory course in R, visualization, and data science online.
- Stats Illustrations: Dr. Allison Horst created and continues to build beautiful illustrations of many R commands you will probably use.
- Teacup Giraffes: A fantastic and visually stunning way to learn R using animations accessible to children but for adults by Dr. Desirée De Leon at RStudio.
- The Tidyverse Cookbook: A bare bones collection of tidyverse commands that serves as an excellent reference.
R in the Wild
A popular (and increasingly standard) way for sharing your analyses and visualizations is to post an annotated explanation of your process somewhere online. RStudio allows you to publish knitted HTML files directly to RPubs, but you can also post your output to a blog or other type of website.^[If you want to be really fancy, you can use blogdown, which makes a complete website with R Markdown files. That’s actually how this site is built ( see the original source code @ andrewheiss). You can build your own site with this tutorial.] Reading these kinds of posts is one of the best ways to learn R, since they walk you through each step of the process and show the code and output.
Sample of R Visualizations
- Bob Ross - Joy of Painting
- Bechdel analysis using the tidyverse: There are also a bunch of other examples using data from FiveThirtyEight
- Comparison of Quentin Tarantino Movies by Box Office and the Bechdel Test
- A decade(ish) of listening to Sigur Rós
- Disproving Approval
- R color Palettes by Emil Hvitfeldt is a very comprehensive list of pre packaged color palettes you can get. He has even compiled all of them into an R package called paletteer
- General (Attys) Distributions
- Health care indicators in Utah counties
- Mapping Fall Foliage
- Personal Blog from Isabella Benabaye with some fun and colorful R and Python data visualizations
- R Charts is a repository of chart based visualizations with corresponding R code
- R Graph Gallery is a collection of visualizations with corresponding R code
- Sexism on the Silver Screen: Exploring film’s gender divide
- Song lyrics across the United States
- Text analysis of Trump’s tweets confirms he writes only the (angrier) Android half (with a follow-up)
- When is Tom peeping these days?: There are a also bunch of final projects from other R and data visualization classes here and here.
- Who came to vote in Utah’s caucuses?