-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmarkdown_parameters.Rmd
61 lines (49 loc) · 1.33 KB
/
markdown_parameters.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
---
#title: "Parameterized Markdown Reports"
title: "`r params$doc_title` island report"
author: "Matt Bixley"
date: "27 August, 2020"
output:
html_document:
code_folding: show
bibliography: resources/markdown.bib
csl: resources/new-zealand-veterinary-journal.csl
params:
island: biscoe
doc_title: biscoe
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
#knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(knitr)
library(janitor)
```
# Objectives
- parameters
- report template
- output
## Read Data
Read in our parameterized data, this uses the `glue package` and we also use `here` to help find our data within our project. Again we are using the Palmer Penguins dataset [@horst2020]
```{r data}
data <- read_csv(here::here('data', glue::glue(params$island, '.csv'))) %>%
clean_names()
```
\pagebreak
### Header 3 - Table
```{r table, echo = F}
data %>%
group_by(species) %>%
select(contains(c("length", "depth", "mass"))) %>%
summarize_all(., mean, na.rm = TRUE) %>%
kable(caption = "Summarized Data", digits = 2)
```
\pagebreak
#### Header 4 - Plot
```{r plot, echo = T}
data %>%
ggplot(aes(x = flipper_length_mm, y = body_mass_g)) +
geom_point(aes(colour = species, shape = species), size = 3) +
labs(title = params$island)
```
# References