-
Notifications
You must be signed in to change notification settings - Fork 10
/
_common.R
executable file
·39 lines (32 loc) · 959 Bytes
/
_common.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
set.seed(1014)
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
# cache = TRUE,
out.width = "70%",
fig.align = 'center',
fig.width = 6,
fig.asp = 0.618, # 1 / phi
fig.show = "hold"
)
options(dplyr.print_min = 6, dplyr.print_max = 6)
# Activate crayon output
options(
crayon.enabled = TRUE,
pillar.bold = TRUE,
stringr.html = FALSE
)
status <- function(type) {
status <- switch(type,
restructuring = "undergoing heavy restructuring and may be confusing or incomplete",
drafting = "draft version, a peer-review publication is pending",
stop("Invalid `type`", call. = FALSE)
)
cat(paste0(
"::: {.rmdnote}\n",
"You are reading the work-in-progress Spatial and spatiotemporal interpolation using Ensemble Machine Learning. ",
"This chapter is currently ", status, ". ",
"You can find the polished first edition at <https://opengeohub.github.io/spatial-prediction-eml/>.\n",
":::\n"
))
}