<- c(
needed_packages "data.table", "broom", "purrr", "dagitty", "ggplot2", "dplyr", "marginaleffects",
"MatchIt","survey","tableone"
)<- "https://mirror.lyrahosting.com/CRAN/" # <- a CRAN mirror in the Netherlands, can select another one from here https://cran.r-project.org/mirrors.html
cran_repo
for (pkg in needed_packages) {
if (!requireNamespace(pkg, quietly = TRUE)) {
install.packages(pkg, repos=cran_repo)
} }
We will work with R. You can use your preferred way of working in R to do the practicals. Our preferred way is this:
- Create a new folder with a good name, e.g.,
practicals_causal_datascience
- Open RStudio
- Create a new project from RStudio, which you associate with the folder
- Create a
raw_data
subfolder - Create an R script for the current practical, e.g.,
introduction.R
- Create your well-documented and well-styled code in this R script
We try to make our practicals light in the number of required packages, but the packages below are needed. You can install them via: