-
Notifications
You must be signed in to change notification settings - Fork 0
/
PDF Paged.Rmd
78 lines (58 loc) · 2.17 KB
/
PDF Paged.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
74
75
76
77
---
title: "Branded PDF Output"
author: "Andy Plunket"
output:
pagedown::html_paged:
self_contained: false
number_sections: false
css: ['styles/brand-0.1.0.css', 'styles/brand-fonts-0.1.0.css', 'styles/brand-page-0.1.0.css']
knit: pagedown::chrome_print
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE)
```
```{r libraries, include=FALSE}
library(tidyverse)
library(lubridate)
library(janitor)
library(scales)
```
# Page Title
<img src="styles/brand-logo.svg" class="footerlogo" style="float:right;"/>
<div class="footerdisclaimer">
Lorem Ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
## Introduction
This is an example of a branded paged PDF template based on html_paged in pagedown.
## Section Heading
### Sub Heading
- Bullet Point 1
- Bullet Point 2
- Bullet Point 3
### Sub Heading
Lorem Ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<div class="pagebreak" />
## Graphs
```{r dataset, include=FALSE}
mac_raw <- read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-12-22/big-mac.csv') |>
clean_names()
```
```{r line graph, fig.height=4}
mac_line <- mac_raw |>
filter(iso_a3 == 'AUS') %>%
filter(year(date) < 2020)
```
#### Graph Title
Subtitle for graph
```{r}
mac_line |>
ggplot(aes(x=date, y=dollar_price, group = iso_a3)) +
theme_minimal() +
theme(
axis.title = element_blank(),
panel.grid.minor = element_blank()
) +
geom_line(colour='grey') +
geom_line(data = . %>% filter(iso_a3 == 'AUS'), colour = 'dark blue') +
scale_y_continuous(labels = comma, limits = c(0, 6), expand = c(0,0))
```