Skip to content

Instantly share code, notes, and snippets.

@pratos
Created August 2, 2018 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pratos/6729a5ead7b3adcebbce4c68d3b47d9e to your computer and use it in GitHub Desktop.
Save pratos/6729a5ead7b3adcebbce4c68d3b47d9e to your computer and use it in GitHub Desktop.
Loading Packages R File : Docker For Data Science Blogpost
list.of.packages <- c("ggplot2", "parallel", "tidyverse", "pROC", "caret", "corrplot", "doParallel", "dummies", "futile.logger")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
# Check whether the packages listed are installed or not
# If not then they are installed
if(length(new.packages)) {
print("Installing new packages")
install.packages(new.packages, repos = "http://cran.us.r-project.org")
}
# Import all the packages in the RSession
lapply(list.of.packages, library, character.only=TRUE)
flog.info("All the packages have been loaded successfully")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment