-
Notifications
You must be signed in to change notification settings - Fork 0
/
_common.R
59 lines (53 loc) · 1.6 KB
/
_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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
## (lightly) adapted from R4DS 2e
# example R options set globally
options(
width = 77, # 80 - 3 for #> comments
pillar.bold = TRUE,
dplyr.print_min = 6,
dplyr.print_max = 6)
# example chunk options set globally
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
# cache = TRUE,
echo = FALSE,
out.width = "80%",
fig.align = "center",
fig.width = 7,
fig.height = 5,
fig.show = "hold"
)
#ggplot2::theme_set(ggplot2::theme_minimal())
status <- function(type) {
status <- switch(
EXPR = type,
polishing = "should be readable but is currently undergoing final polishing",
restructuring = "is undergoing heavy restructuring and may be confusing or incomplete",
drafting = "is currently a dumping ground for ideas, and we don't recommend reading it",
complete = "is largely complete and just needs final proof reading",
stop("Invalid `type`", call. = FALSE)
)
# class <- switch(type,
# polishing = "note",
# restructuring = "important",
# drafting = "important",
# complete = "note"
# )
class <- switch(
EXPR = type,
polishing = "callout-note",
restructuring = "callout-important",
drafting = "callout-important",
complete = "callout-note"
)
cat(paste0(
"\n",
#":::: status\n",
"::: {.", class, "} \n",
"Effective Data Science is still a work-in-progress. ",
"This chapter ", status, ". \n\n",
"If you would like to contribute to the development of EDS, you may do so at <https://github.com/zakvarty/data_science_notes>.\n",
":::\n"
#"::::\n"
))
}