forked from Global-Policy-Lab/mosaiks-paper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.R
executable file
·43 lines (32 loc) · 1.13 KB
/
config.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
######################
# This configuration script is loaded to access all settings for all R scripts.
# To adjust filepaths or other settings across all R scripts, users should only
# have to update this configuration script.
######################
library(here)
root_dir <- paste0(Sys.getenv("MOSAIKS_HOME"),"/")
if (root_dir=="/") {
root_dir = here("")
}
code_dir <- paste0(Sys.getenv("MOSAIKS_CODE"),"/")
if (code_dir=="/") {
code_dir = file.path(root_dir,"code")
}
data_dir <- paste0(Sys.getenv("MOSAIKS_DATA"),"/")
if (data_dir=="/") {
data_dir = file.path(root_dir,"data")
}
res_dir <- paste0(Sys.getenv("MOSAIKS_RESULTS"),"/")
if (res_dir=="/") {
res_dir = file.path(root_dir,"results")
}
# create results directory if it doesn't already exist
dir.create(res_dir, showWarnings=FALSE, recursive=TRUE)
# grid_dir is root/data/grids
grid_dir = file.path(data_dir, "int", "grids")
# features is root/data/features
features_dir = file.path(data_dir, "int", "feature_matrices")
# utils is root/mosaiks/utils
utils_dir = file.path(code_dir, "mosaiks", "utils")
# output is root/data/output
out_dir = file.path(data_dir, "output")