Free online resources for social data science with R

There are many free resources and online books available to learn social data science methods in R. Here is a selection that I have found useful.

General resources

Introductions to applied statistics with R

RLadies Sydney RYouWithMe course: An introductory course split into three: BasicBasics, CleanItUp (data manipulation), VizWhiz (data visualisation), MarkyMark (output in RMarkdown). Some very nice video walk-throughs

Modern dive by Chester Ismay and Albert Y. Kim: This book includes a very nice introduction to R and RStudio in chapter 1 using flights data. Chapters 2-4 cover basic data science; Chapters 5-6 cover data modelling; Chapters 7-10 cover statistical inference, including using bootstrap as an alternative to parametric methods

Learning statistics with R by Dani Navarro: basic statistics for psychologists online book written by one of the RLadies Sydney group, with an emphasis on ANOVA, regression and factorial ANOVA, plus an intro to Bayesian statistics

Quick tips and tricks

Quick-R by Rob Kabacoff: quick introductions to how to implement a range of statistical methods

R Cookbook second edition by James Long and Paul Teetor: a book with a large number of ‘how to’ recipes

Cookbook for R by Winston Chang: similar idea to the Long & Teetor book, but with less detail. Particularly useful for how to modify charts in ggplot2

The peer (and often very expert) help forum on Stack Overflow

Data science and programming in R

R for Data Science by Hadley Wickham and Garrett Grolemund: co-authored by Hadley Wickham, the person responsible for developing the tidyverse. Exploration, wrangling, programming, modelling, communicating

Hand-on programming with R: Chapters 1-3 cover a basic dice-rolling project that introduces basic arithmetic, functions, objects, script files and help

Getting used to R, RStudio and RMarkdown: a short book, with a lot of emphasis on basic programming concepts and RMarkdown

RStudio ‘basics’ primers: visualisation basics - the basics of using ggplot to visualise data; programming basics - functions, arguments, objects, vectors, types, lists, packages. Short videos alongside quiz questions and R exercises to check comprehension

Advanced R by Hadley Wickham - for those who really want to get under the hood of R programming

The tidyverse coding style guide

Useful resources from RStudio

RStudio suggested resources for beginners

Cheatsheets for important R packages

RStudio webinars: lots of useful stuff. Videos are approx. 50 mins each, so many are more appropriate for intermediate / advanced R users

Working with R Markdown

R Markdown reference guide

R Markdown Cookbook by Yihui Xie, Christophe Dervieux and Emily Riederer

R Markdown: The Definitive Guide by Yihui Xie, J. J. Allaire and Garrett Grolemund

bookdown: Authoring Books and Technical Documents with R Markdown by Yihui Xie: write your PhD thesis or your next book in R Markdown

blogdown: Creating Websites with R Markdown, by Yihui Xie, Amber Thomas, Alison Presmanes Hill

Specific methods

Bayesian analysis

An introduction to Bayesian statistics in Learning Statistics with R by Dani Navarro

Statistical Rethinking: a series of YouTube lectures by Richard McElreath, with code in R, to accompany his book of the same name (available via the Bodleian for Oxford University members)

Causal inference / econometrics general

Causal inference: the mixtape, Scott Cunningham - introduction to modern methods of causal inference with examples in R

Introduction to Econometrics with R by Christoph Hanck, Martin Arnold, Alexander Gerber, and Martin Schmelzer

Applied Causal Analysis (with R) by Paul C. Bauer

Data visualisation

ggplot2 book by Hadley Wickham: an online version of the original book on ggplot2

ggplot2 grammar guide: a visual guide to ggplot2

R Graphics Cookbook, 2nd edition by Winston Chang

Data Visualization: A practical introduction by Kieran Healy

Fundamentals of Data Visualisation by Claus O. Wilke

Machine learning

An Introduction to Statistical Learning: with Applications in R, 2nd edition, by James, Witten, Hastie and Tibshirani; there are also video lectures that follow the first edition

Introduction to Data Science: Data Analysis and Prediction Algorithms with R, by Rafael A. Irizarry

Meta-analysis

Doing Meta-Analysis in R by Harrer et al.: a comprehensive applied guide, with very useful links to free resources on the theory

How to perform a meta-analysis with R by Balduzzi et al.: a short tutorial in the Evidence-Based Mental Health on doing meta-analysis with the package meta

The website for the metafor package has data and replication code for around 25 meta-analysis papers using a variety of meta-analysis techniques

R packages for meta-analysis: an overview of the R packages available for meta-analysis

No R, but there are some useful resources on the companion site to Borenstein et al (2021, 2nd edn) Introduction to Meta-Analysis

Missing data methods

Flexible Imputation of Missing Data by Stef van Buuren

Multilevel models

Centre for Multilevel Modelling LEMMA course: a free online course with instructions in R and Stata

NCRM introductory videos on multilevel modelling

Beyond Multiple Linear Regression: Applied Generalized Linear Models and Multilevel Models in R by Paul Roback and Julie Legler

Propensity score matching

Code and walkthrough videos to accompany Leite (2017) Practical Propensity Score Methods Using R

Spatial analysis

Introduction to GIS in R: an introductory tutorial from the Office for National Statistics

sf, Simple Features for R - spatial data, simplified

Geocomputation with R by Lovelace, Nowosad and Muenchow

Spatial Modelling for Data Scientists: an introduction to working with spatial analysis from the University of Liverpool’s Geographic Data Science Lab

Synthetic control

Synthetic control methods for the evaluation of single-unit interventions in epidemiology: a tutorial, Bonander et al (2021): article | replication code

Comparative Politics and the Synthetic Control Method, Abadie et al (2014): article | replication code

Survey analysis

Survey analysis in R: the homepage of the survey package, written and maintained by Thomas Lumley

Text analysis: qualitative

RQDA package: Qualitative Analysis Using R

Text analysis: quantitative

Text Mining with R by Julia Silge and David Robinson

quanteda package: Quantitative Analysis of Textual Data

Text Analysis in R (2017): introductory article by Kasper Welbers , Wouter Van Atteveldt and Kenneth Benoit

Time series and forecasting

Forecasting: Principles and Practice (3rd ed), Hyndman and Athanasopoulos