-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_common.R
45 lines (32 loc) · 814 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
39
40
41
42
43
44
45
set.seed(42)
options(digits = 3)
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
message = FALSE,
warning = FALSE,
cache = TRUE,
echo = FALSE,
#error = TRUE
out.width = "90%",
fig.align = 'center',
fig.width = 6,
fig.asp = 0.618, # 1 / phi
fig.show = "hold",
fig.pos = "h",
#fig.showtext=TRUE,
dev = "pdf",
size = "tiny"
)
script <- TRUE
options(max.print = 20,
dplyr.print_max = 7,
dplyr.print_min = 3)
library(ggplot2)
# change ggplot2 color scheme:
theme_set(theme_minimal())
options(ggplot2.continuous.colour="viridis")
options(ggplot2.continuous.fill = "viridis")
scale_colour_discrete <- scale_colour_viridis_d
scale_fill_discrete <- scale_fill_viridis_d
library(methods) # sometimes not loaded, although built-in, appears like a bug