Helpful resources

Here’s where I’ll put links to helpful resources or things I mention in lab or in the videos.

R Markdown

Programming exercises

  • Advent of Code is an annual series of programming challenges. There are some solutions in R on this blog (search “Advent”)
  • Project Euler is a longstanding and large set of programming challenges. You can check your work with the euler package.
  • has free programming challenges in a number of languages.

To start off:

  • Here’s RStudio’s great list of online resources. In particular, there are some more online tutorials here.

  • Hadley Wickham is probably the #1 R guru and has written several books about R, which you can read on his website, where you can also learn more about the packages he’s written, including ggplot2.

  • Here’s another book with a good introduction to data science R, including data visualization.

  • Used to SAS or STATA? These guides ( SAS and Stata ( 1 & 2)) can help you translate from those languages to R.

  • Some people love learning R with Swirl, which teaches you to code interactively.

  • The fivethirtyeight package has a ton of cool datasets that you can play around with.

  • If you’re not understanding an error message, clear your workspace and/or restart RStudio and try again. Does the error still show up? Then try writing a minimal working example. What does it take to reproduce the error? Is the problem with your data, your code, or both?

  • Watch this video of an expert walk through her process of debugging code (even experts get error messages all the time!).

  • It may sound silly, but copying and pasting error messages into Google is usually the fastest way to solve a tricky problem. You will almost certainly end up on the relevant stack overflow question page, because someone somewhere has experienced the error you’ve encountered.

  • Struggling with ggplot? Take a look at this cheat sheet or this gallery. This website is another great resource.

  • Ready to make your plots beautiful? Choose your color scheme with the RColorBrewer package. Explore ColorBrewer palettes here. “Set1” and “Dark2” are favorites for qualitative data and “BuGn” is nice for sequential gradients.

  • This Rmarkdown cheat sheet is helpful for getting started.