1 min readJun 5, 2020
Great question! Simply create a file called init.R
, and include instructions for package installation. For example, this will install dplyr and collidr:
libraries_to_install <- c("dplyr", "collidr")install_if_missing = function(p) {
if (p %in% rownames(installed.packages()) == FALSE) {
install.packages(p)
}
}invisible(sapply(libraries_to_install, install_if_missing))