What is RMarkdown?
C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE
Timo Grossenbacher
Data Journalist
What is RMarkdo w n ? C OMMU N IC ATIN G W ITH DATA IN TH E - - PowerPoint PPT Presentation
What is RMarkdo w n ? C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE Timo Grossenbacher Data Jo u rnalist What y o u ha v e done so far ... loaded the necessar y libraries ... preprocessed the data w ith mutate() and filter() ... de ned
C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE
Timo Grossenbacher
Data Journalist
COMMUNICATING WITH DATA IN THE TIDYVERSE
...loaded the necessary libraries ...preprocessed the data with mutate() and filter() ...dened a custom theme ...created a dot plot ...polished that plot and made it t for mobile screens
COMMUNICATING WITH DATA IN THE TIDYVERSE Taken from rmarkdown.rstudio.com (hp://rmarkdown.rstudio.com/images/RMarkdownOutputFormats.png)
1
COMMUNICATING WITH DATA IN THE TIDYVERSE
COMMUNICATING WITH DATA IN THE TIDYVERSE
R for Data Science (hp://r4ds.had.co.nz/r-markdown.html)
1
COMMUNICATING WITH DATA IN THE TIDYVERSE
Advantages
you can automate your workow Prerequisites the code needs to be executable the data needs to be provided or at least linked to (the soware environment needs to be known)
C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE
C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE
Timo Grossenbacher
Data Journalist
COMMUNICATING WITH DATA IN THE TIDYVERSE
Markdown was created in 2004 by John Gruber, with the goal of of enabling people "to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid HTML".
Daringreball.net (hps://web.archive.org/web/20040402182332/hp://daringreball.net/projects/markdown/)
1
COMMUNICATING WITH DATA IN THE TIDYVERSE
# A short text ## Introduction Hello, *my name* is **Timo Grossenbacher** and I work at [SRF Data](https://srf.ch/data).
Hello, my name is Timo Grossenbacher and I work at SRF Data.
<h1>A short text</h1> <h2>Introduction</h2> Hello, <em>my name</em> is <strong>Timo Grossenbacher</strong> and I work at <a href = "https://srf.ch/data"> SRF Data</a>.
COMMUNICATING WITH DATA IN THE TIDYVERSE
RMarkdown = Markdown prose + R code For all formaing options see the Pandoc Markdown Reference
C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE
C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE
Timo Grossenbacher
Data Journalist
COMMUNICATING WITH DATA IN THE TIDYVERSE
COMMUNICATING WITH DATA IN THE TIDYVERSE
```{r} x <- 2 + 2 x ```
4
2 plus 2 equals `r 2 + 2`.
2 plus 2 equals 4.
COMMUNICATING WITH DATA IN THE TIDYVERSE
R for Data Science (hp://r4ds.had.co.nz/r-markdown.html)
1
COMMUNICATING WITH DATA IN THE TIDYVERSE
```{r include=FALSE} x <- 2 + 2 x ``` ```{r} x ```
4
COMMUNICATING WITH DATA IN THE TIDYVERSE
Option Eect
include
Whether to show the R code chunk and its output.
echo
Whether to show the R code chunk.
message
Whether to show output messages.
warning
Whether to show output warnings.
eval
Whether to actually evaluate the R code chunk. More options on the respective help page of the knitr package.
C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE
C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE
Timo Grossenbacher
Data Journalist
COMMUNICATING WITH DATA IN THE TIDYVERSE
COMMUNICATING WITH DATA IN THE TIDYVERSE
```{r} ... ggplot2 code ... ```
COMMUNICATING WITH DATA IN THE TIDYVERSE
```{r fig.height = 6} ... ggplot2 code ... ```
COMMUNICATING WITH DATA IN THE TIDYVERSE
Option Possible values Eect
fig.height
Numeric, inches The height of the image in inches.
fig.width
Numeric, inches The width of the image in inches.
fig.align
One of "le", "right" or "center" The alignment of the image in the report. More options on the respective help page of the knitr package.
COMMUNICATING WITH DATA IN THE TIDYVERSE

An impressive mountain
C OMMU N IC ATIN G W ITH DATA IN TH E TIDYVE R SE