-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathglobal.R
55 lines (46 loc) · 1.19 KB
/
global.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
# Global things sourced in each blogpost
# Global stuff ----
library(ggplot2)
library(dplyr)
library(knitr)
#library(extrafont)
source(here::here("helpers.R"))
# Hugo config
# config_toml <- RcppTOML::parseTOML(here::here("config.toml"))
if (!requireNamespace("ragg")) {
message("ragg needs to be installed!")
}
# knitr: Global chunk options
knitr::opts_chunk$set(
dev = "ragg_png",
#out.width = "100%",
fig.retina = 2,
error = FALSE,
warning = FALSE,
message = FALSE,
comment = "",
cache = TRUE
)
# Code highlighting via prims.js requires manually set class
# knitr::opts_chunk$set(
# class.source = c("language-r")
# )
# Set hooks defined in helpers.R
# knitr::knit_hooks$set(
# plot = plot_hook,
# summary = summary_hook
# )
# Plot output ----
# ggplot2 theme
ggplot2::theme_set(
firasans::theme_ipsum_fsc() +
theme(
plot.title.position = "plot",
panel.spacing.y = unit(2.5, "mm"),
panel.spacing.x = unit(2, "mm"),
plot.margin = margin(t = 7, r = 5, b = 7, l = 5),
legend.position = "top",
plot.background = element_rect(fill = "#FCFCFC", color = "#FCFCFC"),
panel.background = element_rect(fill = "#FCFCFC", color = "#FCFCFC")
)
)