Characterizing responsiveness to the COVID-19 pandemic in the United States and Canada using mobility data
This repository contains all data and code necessary to reproduce the analyses presented in the manuscript "Characterizing responsiveness to the COVID-19 pandemic in the United States and Canada using mobility data" by Soucy et al. (doi: 10.1101/2022.11.08.22282050). Note that the included scripts may produce additional tables and figures beyond those directly presented in the manuscript.
All code is written in the R programming language. The easiest way to run it is to use the RStudio IDE. An .Rproj
file is included with this repository for ease of use with RStudio. The analysis script should run with any modern version of R.
The R packages required to reproduce the analyses are listed at the top of each script (and the common functions script, funs.R
). They must be installed using install.packages
or similar functionality within RStudio prior to running each script.
Additionally, the analysis script requires ImageMagick to be installed as part of the figure generation process (used by the package magick
. The binaries for this program should be installed automatically when downloading the package from CRAN on Windows and MacOS but need to be installed manually on Linux.
Raw data have already been downloaded (1_download-data.R
) and processed (2_prepare-data.R
), with the results being available in the raw
, pop
and data
directories, so rerunning them is unnecessary. Some data referenced in 1_download-data.R
were downloaded and processed manually (see comments in script for more details). Run 3_analysis.R
to create the output tables and figures.
The datasets, tables and figures in this repository were produced in the R environment specified in sessionInfo.txt
.