class: center, middle, inverse, title-slide # Reproducible reports in R Markdown ### Jacquie Tran |
@jacquietran
| 18 Aug 2020 ### bit.ly/jt_rladies_2020 --- class: inverse, center, middle # From academia to industry --- class: right, bottom background-image: url(https://raw.githubusercontent.com/jacquietran/2020_aug_rladies_akl/master/images/andrew-petrischev-X03NgRx9f6A-unsplash.jpg) background-size: 35% .small[ Image credit: [Andrew Petrischev](https://unsplash.com/photos/X03NgRx9f6A) ] --- class: right, bottom background-image: url(https://raw.githubusercontent.com/jacquietran/2020_aug_rladies_akl/master/images/emil-widlund-ZtI4l8EvyUw-unsplash.jpg) background-size: 35% Image credit: [Emil Widlund](https://unsplash.com/photos/ZtI4l8EvyUw) --- class: inverse, center, middle # What makes a report reproducible? --- ## Four facets of reproducibility The Carpentries, [Reproducible Research with R](https://datacarpentry.org/rr-intro/01-introduction/index.html) -- 1. Documentation -- 2. Organisation -- 3. Automation -- 4. Dissemination --- class: inverse, center, middle ## R Markdown for # Documentation --- ## Document as you go!  [**Live demo of HTML output**](https://jacquietran.github.io/2020_aug_rladies_akl/penguins_example.html) --- ## Show your "working out" ```r knitr::opts_chunk$set(echo = TRUE) ``` [**Live demo of HTML output**](https://jacquietran.github.io/2020_aug_rladies_akl/penguins_example_echoed.html) --- class: inverse, center, middle ## R Markdown for # Organisation --- ## Source scripts into an R Markdown file  -- In the R Markdown file, source the script from within a code chunk: ```r source(here::here("plot_penguins.R")) ``` --- class: inverse, center, middle ## R Markdown for # Automation --- ## Build reports on a set schedule [**Job scheduling R Markdown reports via R**](https://beta.rstudioconnect.com/content/3132/Job_Scheduling_R_Markdown_Reports_via_R.html)  --- class: inverse, center, middle ## R Markdown for # Dissemination --- ## Rmd: One file format, many outputs! Render an R Markdown report to: - **HTML** - **PDF** - **Word** --- ## HTML outputs are particularly powerful Turn an R Markdown file into: - A **slidedeck** (like this one!) using `{xaringan}` -- - An **interactive dashboard** using `{flexdashboard}` -- - An **e-book** using `{bookdown}` -- - A **website** using packages like `{blogdown}` and `{distill}` --- ## Useful links [R Markdown articles from R Studio](https://rmarkdown.rstudio.com/articles.html) Yihui Xie, J.J. Allaire, & Garrett Grolemund, [R Markdown: The Definitive Guide](https://bookdown.org/yihui/rmarkdown/) Emily Riederer, [R Markdown Driven Development](https://emilyriederer.netlify.app/post/rmarkdown-driven-development/) Tom Mock: - The Mockup Blog, [How I share knowledge around R Markdown](https://themockup.blog/posts/2020-07-25-meta-rmarkdown/) - [Higher, further, faster with marvelous R Markdown](https://bit.ly/marvelRMD), presented at the 2020 New York R Conference -- ### Looking for this slidedeck + related files? Slides: [bit.ly/jt_rladies_2020](https://bit.ly/jt_rladies_2020) GitHub repo: [https://github.com/jacquietran/2020_aug_rladies_akl](https://github.com/jacquietran/2020_aug_rladies_akl)