Run analysis code - Generate graphics - Generate tables - Other quantities (single numbers or summary statistics)
Save it
Import it into you report script
Something changed due to reasons…
Combine report and analysis in one document:
.Rmd fileR Markdown combines Markdown (.md) with the R code
Markdown is a simple markup language
Done by the R package knitr: Runs R code and integrates the result automatically in a markdown document
Rmd files contain 3 parts:
Note the space after #!
Special symbols require a \ in front, e.g. \# for #
Math can be included using $ inline or $$ for math block.
e.g. $\alpha$ will get \(\alpha\)
e.g. the following
$$
\sum_{i = 1}^N X_i
$$
will get \[ \sum_{i = 1}^N X_i \]
Crtl+Alt+I or write it by wrapping code using bakcticks```{r}
R code here
```
```{r Figure 1, eval=TRUE, echo=FALSE}
R code here
```
r like this:` r 1 + 1 ` will just evaluated to 2
Look at the cheat sheets on the web, e.g.
R Markdown and automatic reporting