Skip to content

Instantly share code, notes, and snippets.

@vankesteren
Last active January 18, 2019 10:26
Show Gist options
  • Select an option

  • Save vankesteren/ebab89112c7b1b297990f13eed990875 to your computer and use it in GitHub Desktop.

Select an option

Save vankesteren/ebab89112c7b1b297990f13eed990875 to your computer and use it in GitHub Desktop.
Check packages for DAV
pcks <- c("ISLR", "tidyverse", "haven", "readxl", "MASS", "glmnet", "splines",
"class", "pROC", "rpart", "rpart.plot", "randomForest", "ca",
"igraph")
ip <- rownames(installed.packages())
if (!all(pcks %in% ip)) {
to_install <- pcks[!pcks %in% ip]
message("Package(s) missing. \n",
"Please install the following packages: ",
paste0("\n - ", to_install))
} else {
message("All required packages are installed.")
}
rm(pcks, ip)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment