forked from dcl-docs/data-vis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_common.R
More file actions
35 lines (31 loc) · 680 Bytes
/
Copy path_common.R
File metadata and controls
35 lines (31 loc) · 680 Bytes
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
set.seed(2466)
options(
digits = 3,
dplyr.print_max = 6,
dplyr.print_min = 6
)
knitr::opts_chunk$set(
cache = TRUE,
collapse = TRUE,
comment = "#>",
fig.align = 'center',
fig.asp = 0.618, # 1 / phi
fig.show = "hold"
)
# Stamps plots with a tag
# Idea from Claus Wilke's "Data Visualization" https://serialmentor.com/dataviz/
stamp <- function(
tag = "Bad", tag_color = "#B33A3A", tag_size = 16, tag_padding = 1
)
{
list(
theme(
plot.tag = element_text(color = tag_color, size = tag_size),
plot.tag.position = "topright"
),
labs(
tag =
str_pad(tag, width = str_length(tag) + tag_padding, side = "left")
)
)
}