Branding and Packaging Reports with R Markdown Jake Thompson, PhD - - PowerPoint PPT Presentation

branding and packaging reports with r markdown
SMART_READER_LITE
LIVE PREVIEW

Branding and Packaging Reports with R Markdown Jake Thompson, PhD - - PowerPoint PPT Presentation

Branding and Packaging Reports with R Markdown Jake Thompson, PhD University of Kansas Accessible Teaching, Learning, and Assessment Systems 2020-01-30 rstudio::conf(2020) bit.ly/ratlas-rstudioconf wjakethompson wjakethompson.com


slide-1
SLIDE 1

Branding and Packaging Reports with R Markdown

wjakethompson bit.ly/ratlas-rstudioconf wjakethompson.com @wjakethompson

Jake Thompson, PhD

University of Kansas Accessible Teaching, Learning, and Assessment Systems

2020-01-30 ● rstudio::conf(2020)

slide-2
SLIDE 2

Noelle Pablo

Assistant Psychometrician University of Kansas, ATLAS @noelle_pablo noellepablo

Jeff Hoover

Graduate Research Assistant University of Kansas, ATLAS @JeffreyCHoover JeffreyCHoover

bit.ly/ratlas-rstudioconf

slide-3
SLIDE 3

Reports with R Markdown

  • Reproducible
  • Dynamic
  • Multiple output formats

bit.ly/ratlas-rstudioconf

slide-4
SLIDE 4

!=

bit.ly/ratlas-rstudioconf

slide-5
SLIDE 5

Step 1: Find your brand

bit.ly/ratlas-rstudioconf

slide-6
SLIDE 6

Step 1: Find your brand

bit.ly/ratlas-rstudioconf

slide-7
SLIDE 7

Step 2: Build a template

bit.ly/ratlas-rstudioconf

slide-8
SLIDE 8

Building a Word Template

1. Start writing document in R Markdown.

bit.ly/ratlas-rstudioconf

slide-9
SLIDE 9

Building a Word Template

1. Start writing document in R Markdown.

  • 2. Knit your document.

bit.ly/ratlas-rstudioconf

slide-10
SLIDE 10

Building a Word Template

1. Start writing document in R Markdown.

  • 2. Knit your document.
  • 3. Style and save your word

document.

bit.ly/ratlas-rstudioconf

slide-11
SLIDE 11

Building a Word Template

1. Start writing document in R Markdown.

  • 2. Knit your document.
  • 3. Style and save your word

document.

  • 4. Define your template in your

YAML.

bit.ly/ratlas-rstudioconf

slide-12
SLIDE 12

Resources!

  • Branding and Automating with R Markdown - Daniel Hadley
  • Happy Collaboration with Rmd to docx - Richard Layton
  • R Markdown: The Definitive Guide - Yuihui Xie, J. J. Allair, Garrett

Grolemund

bit.ly/ratlas-rstudioconf

slide-13
SLIDE 13

Step 3: Polish

  • Custom {ggplot2} themes
  • {hrbrthemes} - Bob Rudis
  • {Rtistic} - Emily Riederer
  • {bbplot} - BBC
  • Default {knitr} chunks
  • {knitr} options guide

bit.ly/ratlas-rstudioconf

slide-14
SLIDE 14

What Next?

Copy and paste into each project

  • Templates
  • {ggplot2} themes
  • Other settings

Wrap it up in an R package!

  • Always have the right version
  • Easy to distribute
  • Documentation included

bit.ly/ratlas-rstudioconf

slide-15
SLIDE 15

Use Case: ratlas

  • Templates for reports
  • Convenient project templates
  • {ggplot2} themes
  • Vignettes!

bit.ly/ratlas-rstudioconf

slide-16
SLIDE 16

Package Structure

ratlas |-- DESCRIPTION |-- inst | |-- rmarkdown | |-- rstudio |-- man |-- NAMESPACE |-- R |-- README.md |-- tests |-- vignettes

bit.ly/ratlas-rstudioconf

slide-17
SLIDE 17

inst/rmarkdown/

ratlas |-- inst | |-- rmarkdown | |-- templates | |-- topicguide | |-- resources | |-- template.docx | |-- techreport | |-- resources | |-- template.tex

bit.ly/ratlas-rstudioconf

slide-18
SLIDE 18

R/render.R

topicguide_docx <- function(...) { template <- system.file("rmarkdown", "templates", "topicguide", "template.docx") base <- bookdown::word_document2(reference_docx = template, ...) base$knitr$opts_chunk$echo <- FALSE base$knitr$opts_chunk$fig.asp <- 0.618 base }

bit.ly/ratlas-rstudioconf

slide-19
SLIDE 19

inst/rstudio/

ratlas |-- inst | |-- rstudio | |-- templates | |-- project | |-- topicguide.dcf | |-- topicguide_resources | |-- index.Rmd | |-- references.bib

bit.ly/ratlas-rstudioconf

slide-20
SLIDE 20

Making it easy

bit.ly/ratlas-rstudioconf

slide-21
SLIDE 21

Making it easy

bit.ly/ratlas-rstudioconf

slide-22
SLIDE 22

Making it easy

bit.ly/ratlas-rstudioconf

slide-23
SLIDE 23

Making it easy

bit.ly/ratlas-rstudioconf

slide-24
SLIDE 24

Other Examples!

  • sorensonimpact
  • Sorenson Impact Center
  • Jonathan Zadra, Daniel Hadley, &

Gwendolyn Reynolds

  • thesisdown
  • Reed College (with many forks)
  • Chester Ismay
  • rticles
  • Journal LaTeX templates
  • J. J. Allaire, Yihui Xie, R Foundation, et al.

bit.ly/ratlas-rstudioconf

slide-25
SLIDE 25

Thank you!

bit.ly/ratlas-rstudioconf @wjakethompson wjakethompson.com