-
Notifications
You must be signed in to change notification settings - Fork 0
/
Utilities.R
77 lines (69 loc) · 1003 Bytes
/
Utilities.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#| echo: false
#| results: hide
#| warning: false
knitr::opts_chunk$set(
echo = T,
fig.width = 12,
fig.height = 12,
fig.align = 'center'
)
lib_list <- list(
"tidyverse",
"readr",
"fpp3",
"ggthemes",
"patchwork",
"quantreg",
"broom",
"fitdistrplus",
"EnvStats"
)
lapply(
lib_list,
require,
quietly = TRUE,
warn.conflicts = FALSE,
character.only = TRUE
)
theme_set(
theme_tufte(
base_size = 20
)
)
theme_update(
legend.position = "top"
)
custom_color = scale_color_brewer(
type = 'div',
palette = 'Dark2'
)
custom_fill <- scale_color_brewer(
type = 'div',
direction = -1,
palette = 'Pastel1',
aesthetics = 'fill'
)
tau_sel <- c(
.1,
.25,
.5,
.75,
.9
)
pathmaker <- function(filename, data_path = NULL) {
if (
!is.null(
data_path
)
) {
file_path <- paste0(
data_path,
filename
)
return(
file_path
)
} else {
print("You need to specify the path for your data!")
}
}