-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup_libs.R
41 lines (30 loc) · 901 Bytes
/
setup_libs.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
cat("\n\n## In setup_libs.R: Installing R pakcages ##########################################\n\n")
list.of.packages <- c(
"ggplot2",
"MASS",
"readr",
"dplyr",
"tidyr",
"glue",
"purrr",
"tidyverse",
"boot",
"speedglm",
"foreach",
"doParallel",
"caret",
"e1071",
"xgboost",
"onehot",
"DBI",
"RSQLite",
"keras",
"tensorflow"
)
# create local user library path (not present by default)
dir.create(path = Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)
# install to local user library path
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages, lib = Sys.getenv("R_LIBS_USER"), repos="http://cran.us.r-project.org")
lapply(list.of.packages, require, character.only = TRUE)
cat("\n\n## Exit setup_libs.R: Finish testing R pakcages ##########################################\n\n")