This repository is a clearing house for resources for individual R workshops from Research Computing Services. Materials from a few past workshops that were in this repository have been removed. See the Intro to R repository linked below instead for current versions of those materials.
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. Note: R parts of databases workshop materials are still in the works; will be done by September 11th.
RMarkdown: in progress
For workshops, it's best to install R and RStudio on your own laptop (both are free).
There is a video covering the process available from DataCamp.
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, there are some web based options you could try for accessing R. We are not endorsing these in anyway, just pointing out options that you could explore on your own if needed. They may not allow you to do all of the things we do in the workshops.
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.
DataCamp: Excellent online courses teaching many aspects of R, Python, and SQL. You write R code directly in your web browser as you work through each lesson. DataCamp is aimed at training data scientists, but most of the courses and skills are applicable to academic researchers as well. Some DataCamp courses assume familiarity with basic data analysis concepts, but many teach data analysis skills along with teaching R. Northwestern Research Computing currently has a limited number of subscriptions available for students, faculty, and staff. More information.
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.
Data Analysis and Visualization using R: an online course from David Robinson, whose blog is also worth following.
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, who wrote many of the packages you use throughout the assignments in this workshop, and Garrett Grolemund, who also works at RStudio. I wouldn't start with this as a complete newbie, but after the intro R workshop, you should be ok to start with this. It may also be a useful reference for beginners working on the intro R exercises. It includes exercises for you to practice the skills you are learning.
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
Awesome R: a curated list of awesome R packages, frameworks and software
RStudio Webinars cover a wide range of topics on using R and RStudio
Reproducible Science in R: recommended practices and tips
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
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
R for SAS and SPSS Users is an early, condensed version of a book by the same name, from Bob Muenchen of r4stats.com
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.
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.
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 ggplot2
.
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 ggplot2
.
Cookbook for R, Statistical Analysis section provides examples of many basic statistical methods.
An Introduction to Statistical Learning with Applications in R is a statistics book that uses R for examples and exercises. It's a standard text for many statistics programs.
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
DataCamp: Intro to Statistics with R: free DataCamp course -- very basic statistics
See the 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
Understanding Vectorization in R: Vectorization in R: Why? by Noam Ross or Let's talk about vectorization by Alyssa Frazee
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.
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
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
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