-
Notifications
You must be signed in to change notification settings - Fork 0
/
_common.R
41 lines (38 loc) · 883 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
set.seed(2023)
library(tidyverse)
knitr::opts_chunk$set(
comment = "#>",
# collapse = TRUE,
fig.retina = 2,
fig.width = 8
# fig.show = "hold"
)
# # For PDF output
# knitr::opts_chunk$set(
# comment = "#>",
# size = "scriptsize",
# collapse = TRUE,
# cache = TRUE,
# cache.lazy = FALSE,
# fig.width = 10,
# width = 30,
# out.width = 550
# )
#
# default_chunk_hook <- knitr::knit_hooks$get("chunk")
#
# latex_font_size <- c("Huge", "huge", "LARGE", "Large",
# "large", "normalsize", "small",
# "footnotesize", "scriptsize", "tiny")
#
# knitr::knit_hooks$set(chunk = function(x, options) {
# x <- default_chunk_hook(x, options)
# if(options$size %in% latex_font_size) {
# paste0("\n \\", options$size, "\n\n",
# x,
# "\n\n \\normalsize"
# )
# } else {
# x
# }
# })