Introduction

About

This website is intended as a quick reference for some techiques that I think people may need to keep their code reprodubicle when cleaning, analyzing, or presenting data. For a more basic intro to R try the R for Social Science Data Carpentry Workshop , on which some of this website is based.

The site covers advice on workflows, and general R techniques such as loops and functions, as well as specific code examples to do common tasks such as reporting on regressions, power calculations and visualizing data.

Setting up

This book uses the SAFI data set, and a large number of libraries. The following will download them all. I use the here package to manage paths.

#make sure your working folder is set to something sensible!

file.create(".here")
here::i_am(".here")
library(here)

dir.create(here("data"))

download.file(
  "https://raw.githubusercontent.com/datacarpentry/r-socialsci/main/episodes/data/SAFI_clean.csv",
  here("data/SAFI_clean.csv"), mode = "wb"
)

install.packages(c("tidyverse","here","arsenal","lmtest","sandwich","here",
                   "huxtable","flextable","declaredesign","fixest"))