-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rprofile
37 lines (33 loc) · 880 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
# 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. Run renv::init() to continue\n")
}
if (interactive()) {
renv::status()
}
} else {
cat("* Run renv::init() to install the R packages for this project\n")
}
# 2. directory structure
.folder.struct <- c(
"data/input",
"data/intermediate/calibration",
"data/intermediate/diagnostics",
"data/intermediate/estimates",
"data/intermediate/scenarios",
"data/output",
"out",
"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)