-
Notifications
You must be signed in to change notification settings - Fork 1
/
00-global.R
43 lines (36 loc) · 1.21 KB
/
00-global.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
39
40
41
42
43
if (!exists("pkgDir")) {
topLevelPkgDir <- if (Sys.info()[["user"]] == "emcintir") {
"../packages_MPB_SK"
} else {
"packages"
}
pkgDir <- file.path(topLevelPkgDir, version$platform,
paste0(version$major, ".", strsplit(version$minor, "[.]")[[1]][1]))
if (!dir.exists(pkgDir)) {
dir.create(pkgDir, recursive = TRUE)
}
.libPaths(pkgDir)
}
#devtools::install("../reproducible")
#devtools::load_all("~/GitHub/SpaDES.tools")
#devtools::load_all("~/GitHub/SpaDES.core")
switch(Sys.info()[["user"]],
"achubaty" = Sys.setenv(R_CONFIG_ACTIVE = "alex"),
"emcintir" = Sys.setenv(R_CONFIG_ACTIVE = "eliot"),
Sys.setenv(R_CONFIG_ACTIVE = "default")
)
#Sys.getenv("R_CONFIG_ACTIVE") ## verify
source("03-packages.R")
source("01-init.R")
source("02-paths.R")
source("04-options.R")
#source("05-google-ids.R") ## gets sourced at top of each script 06, 07x, 08x
cloudCacheFolderID <- "175NUHoqppuXc2gIHZh5kznFi6tsigcOX"
if (delayStart > 0) {
message(crayon::green("\nStaggered job start: delaying by", delayStart, "minutes."))
Sys.sleep(delayStart*60)
}
source("06-studyArea.R")
#source("07-dataPrep.R") ## skip for now
source("08-MPB-spread-fit.R")
source("09-main-sim.R")