-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_libraries.R
More file actions
43 lines (37 loc) · 1.3 KB
/
_libraries.R
File metadata and controls
43 lines (37 loc) · 1.3 KB
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
39
40
41
42
43
# Assumes use of docker containers setup in sh/docker_init.sh
cran_list <- c("magrittr",
"tibble",
"here",
"readr",
"janitor",
"dplyr",
"ggplot2",
"xml2",
"rvest",
"devtools",
"config",
"stringr",
"purrr",
"RSelenium",
"tibble",
"nflfastR",
"googlesheets4")
install_list <- cran_list[!(cran_list %in% installed.packages())]
if (length(install_list)) {
install.packages(install_list)
}
# https://ffanalytics.fantasyfootballanalytics.net/
if (!("ffanalytics" %in% installed.packages())) {
devtools::install_github("FantasyFootballAnalytics/ffanalytics")
}
library_list <- c(cran_list, "ffanalytics")
lapply(library_list, require, character.only = TRUE)
missing_list <- library_list[!(library_list %in% .packages(TRUE))]
if (length(missing_list)) {
stop(paste0("The following packages were not loaded: "), (paste(missing_list, collapse=", ")))
} else {
# source each file in the R directory
sapply(list.files(here::here("R"), full.names = TRUE), source)
dir.create(here::here("out/"), showWarnings = FALSE)
dir.create(here::here("out/latest/"), showWarnings = FALSE)
}