# Ensures the package "pacman" is installed
install.packages("pacman")
pacman::p_load(
# project and file management
#############################
here, # file paths relative to R project root folder
rio, # import/export of many types of data
openxlsx, # special functions for handling Excel workbooks
# package install and management
################################
remotes, # install from github
# general data management
#########################
tidyverse, # includes many packages for tidy data wrangling and presentation
# tables and statistics
#######################
janitor, # tables and data cleaning
gtsummary, # making descriptive and statistical tables
# plots - general
#################
# ggplot2, # included in tidyverse
cowplot, # combining plots
RColorBrewer, # color scales
gghighlight, # highlight a subset
ggrepel, # smart labels
ggExtra, # fancy plots
tsibble, # working with time series
viridis, # colorblind-friendly scales
scales, # helper functions
# routine reports
#################
rmarkdown, # produce PDFs, Word Documents, Powerpoints, and HTML files
# tables for presentation
#########################
knitr, # R Markdown report generation and html tables
flextable,
# advanced statistic package
dlnm # Distributed Lag Non-Linear Models
)
Pre-workshop instructions
1. Software
Download and install the latest versions of R, RStudio, and Quarto:
- R 4.4.2 or above: https://cran.r-project.org
- RStudio 2024.12.1 or above: https://posit.co/download/rstudio-desktop
- An alternative to Rstudio is Positron, a next generation of Rstudio allowing you to work with R and Python together https://positron.posit.co/download.html
- Install Positron Data Science Pack extension https://open-vsx.org/extension/ntluong95/positron-data-science-pack
- Quarto 1.6 or above: https://quarto.org/docs/download
2. R Packages
Install the following packages by copying and pasting the following into the console in RStudio/Positron
3. Resources
Here are some good readings you can check before the workshop:
- The Epidemiologist R Handbook
- Posit Recipes
- Big Book of R
- Free R Course from The Global Health Network
- A ggplot2 Tutorial for Beautiful Plotting in R
- Doing Meta-analysis in R
- Forecasting: Principles and Practice
- CrossCarry: An R package for the analysis of data from a crossover design with GEE
- Tutorial code for “Distributed Lag Linear and Non-Linear Models in R: The Package dlnm”