-
Notifications
You must be signed in to change notification settings - Fork 2
/
.Rprofile
41 lines (37 loc) · 995 Bytes
/
.Rprofile
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
# 0. Disable `renv` sandboxing if non-interactive
if (!interactive()) options(renv.config.sandbox.enabled = FALSE)
# 1. renv package management
if (dir.exists("renv/")) {
if (file.exists("renv/activate.R")) {
source("renv/activate.R")
} else {
cat(
"* renv may have been incompletely set up.\n",
" Run renv::init(bare = TRUE) to continue\n"
)
}
if (interactive()) renv::status()
} else {
cat(
"* Run renv::init(bare = TRUE) to install the R packages for this project\n"
)
}
# 2. directory structure
.folder.struct <- c(
"data/input",
"data/run/calibration",
"data/run/diagnostics",
"data/run/estimates",
"data/run/scenarios",
"data/output",
"workflows"
)
for (.folder in .folder.struct) {
if (!dir.exists(.folder)) dir.create(.folder, recursive = TRUE)
}
rm(.folder.struct, .folder)
# 3. Helpful aliases
rs <- function() .rs.restartR()
si <- function() sessioninfo::session_info()
# 4. Standard options
options(deparse.max.lines = 5)