-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathreport.Rmd
104 lines (76 loc) · 4.86 KB
/
report.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
pagetitle: Report
output:
html_document:
pandoc_args: [
"--number-offset=4"]
editor_options:
chunk_output_type: console
---
```{r, include=FALSE}
knitr::opts_chunk$set(echo = T, warning = F, message = F)
if (!require(librarian)){
install.packages("librarian")
library(librarian)
}
shelf(
htmltools, mitchelloharawild/icons)
```
# Report
## Learning Objectives {.unnumbered .objectives}
Dive into Rmarkdown for for knitting formatted text (markdown) with chunks of evaluated R code into html, pdf and docx formats. Use Rmarkdown for single page reports, bookdown for reports with chapters, flexdashboard for dashboards and Rmarkdown websites for simple websites with shared navigation. Automatically render with Github Actions.
- Rmarkdown basics
- YAML as frontmatter of Rmd, `_site.yml` for [Rmd website](https://bookdown.org/yihui/rmarkdown/rmarkdown-site.html)
- Rmarkdown Cheatsheets
- RStudio's Visual Markdown Editor
- R code as chunks or inline
- Navigate: toc sidebar, chunk dropdown, knit gear options, insert chunk
- Equations
- Tables
- References with [citr](https://github.com/crsh/citr)
- pandoc: docx for track changes editing, pdf (tinytex) for archive
- html options: toc floating, code hide/show
- [bslib](https://rstudio.github.io/bslib/)
- Product [formats](https://rmarkdown.rstudio.com/formats.html)
- [**website**](https://bbest.github.io/r3-exercises/report-website/)
- source: [report-website](https://github.com/bbest/r3-exercises/tree/main/report-website)
- format: [Rmd website](https://bookdown.org/yihui/rmarkdown/rmarkdown-site.html)
- techniques:
- [Parameterized reports](https://bookdown.org/yihui/rmarkdown/params-declare.html)
- [Render automatically with Github Action](https://github.com/r-lib/actions/tree/master/examples)
- [**dashboard**](https://bbest.github.io/r3-exercises/report-dashboard/)
- source: [report-website](https://github.com/bbest/r3-exercises/tree/main/report-dashboard)
- format: [`flexdashboard`](https://pkgs.rstudio.com/flexdashboard/)
- technique: [`knitr::knit_expand()`](https://bookdown.org/yihui/rmarkdown-cookbook/knit-expand.html)
- [**book**](https://bbest.github.io/r3-exercises/report-book/)
- source: [report-book](https://github.com/bbest/r3-exercises/tree/main/report-book)
- format: [`bookdown`](https://bookdown.org)
- [**slides**](https://bbest.github.io/r3-exercises/report-slides.html)
- source: [report-slides.Rmd](https://github.com/bbest/r3-exercises/blob/main/report-slides.Rmd)
- format: [`xaringan`](https://bookdown.org/yihui/rmarkdown/xaringan-format.html)
- [**article**](https://bbest.github.io/r3-exercises/report-article/report-article.pdf)
- source: [report-article](https://github.com/bbest/r3-exercises/tree/main/report-article)
- format: [`rticles`](https://bookdown.org/yihui/rmarkdown/journals.html)
## Rmd Website
## Source:
* [Alaska Marine Ecosystem Status Reports](https://apps-afsc.fisheries.noaa.gov/refm/reem/ecoweb/Index.php?ID=9)
* [REEM Ecosystem Considerations and Assessment](https://apps-afsc.fisheries.noaa.gov/refm/reem/ecoweb/dataWindow.php?Data=NPI)
### Parameterize Rmd
* [15.1 Declaring parameters | R Markdown: The Definitive Guide](https://bookdown.org/yihui/rmarkdown/params-declare.html)
* [17.4 Parameterized reports | R Markdown Cookbook](https://bookdown.org/yihui/rmarkdown-cookbook/parameterized-reports.html)
* [Parameters](https://rmarkdown.rstudio.com/lesson-6.html)
### Automatic generation with Github Action
* [bbest/gh-actions-demo: Demonstration of using Github Actions to update your Rmarkdown analysis](https://github.com/bbest/gh-actions-demo)
* [Automatically Update your Report with Github Actions](https://bbest.github.io/gh-actions-demo/#22)
* [gh-action-test-rmd/render-rmarkdown.yaml at main · bbest/gh-action-test-rmd](https://github.com/bbest/gh-action-test-rmd/blob/main/.github/workflows/render-rmarkdown.yaml)
* [Events that trigger workflows - GitHub Docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule)
* [actions/README.md at master · r-lib/actions](https://github.com/r-lib/actions/blob/master/examples/README.md)
## Flexdashboard
Another example [source](https://github.com/BenioffOceanInitiative/ship-cards): [table of ships](https://benioffoceaninitiative.github.io/ship-cards/) to [ship detail](https://benioffoceaninitiative.github.io/ship-cards/ship/CARNIVAL%20IMAGINATION.html).
### Synchronize time selection in dygraphs
* [Synchronization](https://rstudio.github.io/dygraphs/gallery-synchronization.html)
## Organizing with _child documents
## Further Resources {.unnumbered}
* [Formats](https://rmarkdown.rstudio.com/formats.html)
* [R Markdown Format for Flexible Dashboards • flexdashboard](https://pkgs.rstudio.com/flexdashboard/index.html)
* [Reproducible Research in R](https://monashdatafluency.github.io/r-rep-res/)