Resources for learning R

This was a no-code approach to data literacy, but several people have asked for some resources for learning R. Here I’ll share a few of my favorite things. One thing to know right off the bat is that R has several different-looking but equally valid “syntaxes”

I have a keynote talk I gave at useR! (the international R users conference) titled Speaking R about how to vocalize R code in different syntaxes while you’re teaching it.

R and RStudio

R is the programming language, which you need in order to code in R! It is free and open source. You could code in R from the commandline or from the default R Graphical User Interface (GUI) but…

RStudio is the industry-standard Integrated Development Environment (IDE), which makes it easier to code in R. It is free and open source. Some companies buy an enterprise version, which allows them more support but not necessarily more features.

Downloading R and RStudio

In order to use R and RStudio, you need access to them! There is a cloud version that allows you a few hours of compute time per month for free, and is pretty cheap after that. If you just want to give R a quick try, this can be a good way to start. I have used this with intro classes where I don’t want students to get bogged down in software installs. In upper level classes where we use it more heavily, I ask students to install it locally.

If you really want to learn R, I suggest installing it locally.

There are several steps to this process, so I made a YouTube video to walk students through it. There are three main steps:

  1. Download and install R
  2. Download and install RStudio Desktop
  3. Install whatever packages you need to do your work. I’ve made a big list of potential packages, which you may or may not need all of. To install them, run this entire piece of code:
install.packages(c("tidyverse", "babynames", "broom", "coefplot", "cowplot", "devtools", "drat", "fueleconomy", "fivethirtyeight", "formatR", "gapminder", "GGally", "ggforce", "ggraph", "ggrepel", "ggridges", "graphlayouts", "gridExtra", "here", "hexbin", "interplot", "janitor", "margins", "mgcv", "maps", "mapproj", "nycflights13", "RColorBrewer", "rmarkdown", "sf", "skimr", "usethis", "viridis", "viridisLite"))

I’m happy to help troubleshoot if you run into any issues!

Learning R

  • If you want a self-paced way to learn R, DataQuest is the website I recommend. It has R content as well as other programming languages like Python. It does cost money

  • Their competitor that I do not recommend is called DataCamp. Here’s an overview: Don’t use DataCamp. There is so much more media coverage. (Oh, and the CEO has been quietly reinstated!)

  • If you want a free way to learn R, the website learnR4free has (you guessed it!) free resources for learning R. They have materials in English, Turkish, and Spanish.

  • The book R for data science (free online) is a common resource for learning R. There is also a supportive online community called the R for data science online community that you can join for free. They have a Slack group, and I have heard there is almost always a group of people working their way through the r4ds book together and asking questions online.

Community

One of the things that makes R a popular programming language is our great community. I’ve already mentioned the R for data science online community, which is an online community. There are also lots of in-person communities for R:

  • R Ladies is a group for women and gender minorities who use R. Most major cities have a chapter. For example, there is a New Orleans chapter!

  • Usually there is also a general R users group in each city. I don’t see one in New Orleans, but I do see a Tulanians Who Enjoy R Coding (TWERC) group.

Resources

As you learn, you will have questions! Here are some resources to help you answer them.

Books

Teaching R

  • Again, you might want to read me and my colleague’s piece An educator’s perspective of the tidyverse
  • Mine Cetinkaya-Rundel (the first author on that piece) has a website Data Science in a Box, which has lots of materials for teaching data science. It also has her design philosophy, which includes “Start with cake”

Videos

Let’s say you’re not sick of my voice after a full week of it. I have a ton of YouTube videos with content related to learning R. For example,

Writing reproducible reports

Another powerful thing about R is the tooling around writing reproducible reports. Here are some resources related to that: