Created
August 2, 2018 07:22
-
-
Save pratos/6729a5ead7b3adcebbce4c68d3b47d9e to your computer and use it in GitHub Desktop.
Loading Packages R File : Docker For Data Science Blogpost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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