-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.Rmd
73 lines (67 loc) · 1.57 KB
/
setup.Rmd
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
```{r setup, include=FALSE}
# R options
options(
htmltools.dir.version = FALSE,
dplyr.print_min = 6,
dplyr.print_max = 6,
tibble.width = 65,
width = 65
)
# figure height, width, dpi
knitr::opts_chunk$set(
echo = TRUE,
fig.width = 8,
fig.asp = 0.618,
out.width = "60%",
fig.align = "center",
dpi = 400,
message = FALSE,
knitr.duplicate.label = "allow"
)
# ggplot2
ggplot2::theme_set(ggplot2::theme_gray(base_size = 16))
# set seed
set.seed(1234)
# fontawesome
htmltools::tagList(rmarkdown::html_dependency_font_awesome())
# magick
dev.off <- function() {
invisible(grDevices::dev.off())
}
# conflicted
library(conflicted)
conflict_prefer("filter", "dplyr")
# Remember to compile
# xaringan::inf_mr(cast_from = "..")
# xaringanExtra
# library(xaringanExtra)
# xaringanExtra::use_panelset()
# output number of lines
hook_output <- knitr::knit_hooks$get("output")
knitr::knit_hooks$set(output = function(x, options) {
lines <- options$output.lines
if (is.null(lines)) {
return(hook_output(x, options)) # pass to default hook
}
x <- unlist(strsplit(x, "\n"))
more <- "..."
if (length(lines) == 1) { # first n lines
if (length(x) > lines) {
# truncate the output, but add ....
x <- c(head(x, lines), more)
}
} else {
x <- c(more, x[lines], more)
}
# paste these lines together
x <- paste(c(x, ""), collapse = "\n")
hook_output(x, options)
})
```
layout: true
<div class="my-footer">
<span>
<a href="https://DataScience4Psych.github.io/DataScience4Psych/" target="_blank">Data Science for Psychologists</a>
</span>
</div>
---