Incomplete sheet
This sheet is incomplete and could use some attention. Please submit code snippet suggestions as an issue or PR here.
Rmarkdown
Page info
| Action |
Code |
Details |
|
Title
|
|
|
|
Author
|
|
|
|
Author with e-mail as footnote
|
author: John Smith^[example@example.com]
|
|
|
Authors
|
|
|
|
Date
|
|
|
|
Current date (dynamically)
|
date: "r format(Sys.time(), '%d %B %Y')"
|
|
|
Keywords
|
|
|
Text formatting
| Action |
Code |
Details |
|
Bold
|
|
|
|
Italic
|
|
|
|
Hyperlink with label
|
|
|
|
Code
|
|
|
|
Equation
|
|
|
Document structuring
Sectioning
| Action |
Code |
Details |
|
Section
|
|
|
|
Unnumbered section
|
|
|
|
Hide section from ToC
|
# Section title {.toc-ignore}
|
|
|
Tabbed section
|
## title {.tabset .tabset-fade}
content above tabbed region.
### tab 1
tab content 1
### tab 2
tab content 2
##
content below tabbed region
|
The newlines are crucial! |
|
Subsection
|
|
|
|
Subsubsection
|
|
|
|
Paragraph
|
|
|
|
Collapsible paragraph
|
<details>
<summary>Show details…</summary>
<p>Derp</p>
</details>
|
|
|
Horizontal line
|
|
|
Lists
| Action |
Code |
Details |
|
Define unordered list
|
|
|
|
Define nested list
|
|
|
|
Dynamic list from code section
|
```{r, results='asis'}
paste0('* ', items, collapse='
') %>% cat
</td>
<td markdown="1"></td>
</tr>
</table>
## Figures
<table markdown = "1">
<thead>
<tr>
<th class="th-action">Action</th>
<th class="th-code">Code</th>
<th class="th-details">Details</th>
</tr>
</thead>
<tr markdown="1">
<td markdown="1">
Captioned dynamic figure from R code
</td>
<td>
```md
```{r, fig.align="center", fig.width=6, fig.height=6,
fig.cap="Figure: Your caption here."}
R CODE HERE
</td>
<td markdown="1"></td>
</tr>
<tr markdown="1">
<td markdown="1">
Dynamic subfigures from R code
</td>
<td>
```md
```{r out.width=c('50%', '50%'), fig.show='hold'}
boxplot(1:10)
plot(rnorm(10))
</td>
<td markdown="1"></td>
</tr>
<tr markdown="1">
<td markdown="1">
Interactive ggplot
</td>
<td>
```md
```{r}
p = ggplot(data, aes(x=x, y=y, color=z)) +
geom_point()
plotly::ggplotly(p)
</td>
<td markdown="1"></td>
</tr>
</table>
## Tables
<table markdown = "1">
<thead>
<tr>
<th class="th-action">Action</th>
<th class="th-code">Code</th>
<th class="th-details">Details</th>
</tr>
</thead>
<tr markdown="1">
<td markdown="1">
Dataframe as table
</td>
<td>
```md
kable(df)
|
|
|
Dynamic sortable table from dataframe
|
|
|
|
Scrollable table from dataframe
|
DT::datatable(mtcars, rownames = FALSE,
filter="top", options = list(pageLength = 5, scrollX=T) )
|
|
|
Named list as table
|
`r unlist(mylist) %>% as.data.frame %>% kable(col.names='Value')`
|
|
|
Knitr params list as table
|
`r unlist(params) %>% as.data.frame %>%
kable(col.names='Value', caption='Parameters')`
|
|
Code block options
To hide code blocks by default, set code_folding: "hide" in the output document parameters.
| Action |
Code |
Details |
|
Run, show output only
|
|
|
|
Run, show code only
|
|
|
|
Show code, don't run
|
|
|
|
Interpret output as markdown code
|
|
|
|
Hide messages
|
|
|
|
Hide warnings
|
|
|