<- function(pkg) {
ipak <- pkg[!(pkg %in% installed.packages()[, "Package"])]
new.pkg if (length(new.pkg)) {
install.packages(new.pkg, dependencies = TRUE)
}
}
<- c('dplyr', 'wooldridge')
packages
ipak(packages)
Preparation
As part of Statistic 1 - 3, we will need some R packages. We recommend installing them before the first lesson. Similar to the preparation exercise in Prepro1 you can use the code below to automatically install all packages that have not yet been installed.