This repository is a clearing house for resources for individual R workshops from Research Computing Services.
Databases: Information on how to connect to databases from R is part of the databases workshop materials, which also covers the basics of SQL. The example code there may be a useful reference, but you'll need a database connection to run it. See that repository for more details.
For workshops, it's best to install R and RStudio on your own laptop (both are free).
If you do not have administrator privileges on your work computer, either work with the relevant IT department to get R and RStudio installed, or use a different laptop for the workshop.
If, for some reason you can't install R and RStudio, consider using RStudio Cloud.
See Software Installation for more details.
RStudio Cheat Sheets are short pdfs that summarize key R functions on specific topics. Many people print them out for reference while working in R. The
ggplot cheat sheet, in particular, in indispensable.
R Reference Card: lists many commonly used functions
RStudio Primers: interactive documents with videos, exercises, and explanations
RStudio Learning: a list of resources from RStudio
Swirl: Swirl courses run interactively directly in R. There courses teach both statistical concepts and R together. See the Swirl website for instructions on installing and using the package.
OnePageR: Series of tutorials and sometimes book chapters on using R for data science. Emphasis here is on machine learning models, but there's lots of useful info for people using R for other purposes as well.
UBC Stat 545: Data wrangling, exploration, and analysis with R: includes exercises (homework) if you're looking to practice your skills more
R for Data Science is a book available online. It is written by Hadley Wickham and Garrett Grolemund, who work at RStudio and wrote many of the popular R packages for data manipulation. There's a welcoming online community of folks working on material from this book.
An Introduction to Statistical and Data Sciences via R by Chester Ismay and Albert Y. Kim: learn data science and statistics concepts along with R
The Use R! series of books are available online through the Northwestern library. Search the library catalog for the title you're interested in, then follow the links in the search result to gain access to the online version of the book. The series has a few titles about general skills, but many additional domain-specific titles. Pay attention to the publication date, as occasionally information may be outdated (although usually still a good reference).
Advanced R by Hadley Wickham, for when you're ready to take the next step. Much of the material here you won't need when just doing routine analysis with R, but it's essential material if you're trying to really understand how R works.
Materials from other workshops. These resources often include materials for both instructors and students. They are often good resources if you're learning on your own as well though too.
Harvard IQSS Workshops: Harvard's Institute for Quantitative Social Science, Data Science Services has their workshop materials online.
Software Carpentry: R for Reproducible Scientific Analysis: provides a good introduction to R. The materials are meant for teaching an in-person workshop, but you can work through them on your own as well.
R Beginner Workshop from Ann Arbor R User Group; covers a similar range of material to our intro R workshop
Berkeley D-lab R Fundamentals covers a similar range of material to our intro R workshop
University of Cambridge: extensive set of workshops taught on a wide range of R topics.
R for Researchers online workshop materials from University of Wisconsin Social Science Computing Cooperative
RStudio Webinars cover a wide range of topics on using R and RStudio
R Exercises has a large collection of exercises on different topics that you can work through. The website isn't the best format, but there's useful content there.
R for Reproducible Research
Reproducible Science in R: recommended practices and tips
Git and R
Happy Git with R: another resource from UBC Stat 545 and Jenny Bryan's team
Github Quickstart for Scientists: aims just at teaching the workflow that many scientists use
R for Users of Other Statistical Programs
If you're coming to R from Stata, SPSS, SAS, Matlab, or Python, the following resources might be useful to you. Some of them may be a little outdated, but each contains some tables of equivalent commands across programs that might help you get familiar with R more quickly.
R/Stata Comparison from Princeton's Data & Statistical Services
The Tidynomicon: R for Python Programmers by Greg Wilson; may be helpful for those coming to R from other C-derived programming languages as well.
Matlab/R Reference: from David Hiebeler of the University of Maine.
Matlab/NumPy (Python)/R Commands Chart: from Vidar Bronken Gundersen; this one is about 10 years old, but it mostly covers basic commands, which haven't changed
haven Package: for importing Stata, SAS, and SPSS data into R.
Statistics and Machine Learning
Many of the resources above include statistical components. In addition, the resources below have a particular focus on statistics.
UCLA's Statistics Consulting Group has a great set of tutorials showing how to conduct many types of ANOVA and regression analysis in various statistical packages, including R. Highly recommended; check here first.
An Introduction to Statistical Learning with Applications in R: book, available online, by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani
The Elements of Statistical Learning: Data Mining, Inference, and Prediction: book, available online, by Trevor Hastie, Robert Tibshirani, Jerome Friedman
Deep Learning with R: book, by François Chollet with J. J. Allaire
Quick-R has many example snippets of R code covering statistical topics. Note that the visualization sections use the base R plotting functions and not
Kelly Black's R Tutorial covers a few R basics, but then moves on to cover various statistical functions. Like the other resources above, it also uses base R plotting functions instead of
Cookbook for R, Statistical Analysis section provides examples of many basic statistical methods.
edX Statistics and R covers basic statistical concepts.
A Little Book of R for Bioinformatics covers basic analysis topics in the field.
Bioconductor, which provides tools and R packages for analysis of genomic data, has an archive of materials from various workshops and presentations.
Learning Statistics with R is an online book from a psychology professor who teaches statistics in his department. It covers both statistical concepts and R.
R Workshop Materials, mostly on specific statistical topics, from Michael Clark with University of Michigan Advanced Research Computing
ggplot workshop for additional resources too.
R Graph Gallery: gives examples of visualizations produced in R and the code needed to produce them. This is a great way to learn how to implement specific plotting features you're looking for or how to make certain kinds of plots.
Flowing Data: this is a general data visualization blog, but author Nathan Yau produces the visualizations he creates in R. There are some tutorials for subscribers as well. He also has books that include real data analysis examples that use R.
ggplot Tutorials by Max Woolf, an R notebook and code for making high quality visualizations in R
Linear Algebra in R by Søren Højsgaard
Asking the Internet for Help
Someone has probably had the same question as you before.
Rseek.org searches several different R sites and resources. It's essentially a more targeted version of Google.
StackOverflow R section: StackOverflow is a go-to resource for people writing code in nearly any language. Please extensively search the site for your answer before asking a new question. When looking at previous answers, make sure to look at the date, as some information may be old.
R-bloggers: hundreds of R users write examples and tutorials on their own blogs and contribute their content to this aggregator.
Tips for Beginners
Why R is Hard to Learn, by Robert A. Muenchen, points out issues that can trip up or frustrate beginners. Useful both for beginners and instructors
Writing Better R Code
Looking to take your R code to the next level? Ready to move beyond "It works" to "It works well" or "I'd like others to be able to read/use this"?
Writing Good R Code and Writing Well by Joseph Rickert points to lots of other good resources
Writing Better R Code by Laurent Gatto
Tidyverse Style Guide: style guide used by authors of some of R's most popular packages
The Zen of R: a example of improving R code, by Daniel Kwiecinski
Efficient R Programming by Colin Gillespie and Robin Lovelace
A Guide to Analyzing (American) Political Data in R by G. Elliott Morris
She Giggles, He Gallops by Julia Silge, et al., is an example of text analysis and data visualization.
Movie Lead Gender and Box Office by Max Woolf
Animated Maps in R with SF and gganimate from Culture of Insight
Poisoned Baby Names from Hilary Parker
Exploring Minard's 1812 Plot with ggplot2 by Andrew Heiss