-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-usage.Rmd
More file actions
43 lines (36 loc) · 857 Bytes
/
example-usage.Rmd
File metadata and controls
43 lines (36 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
title: "Example Usage"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{example-usage}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup}
library(tabtibble)
library(dplyr)
```
The `tabtibble` package is typically used to create a list of tables for
reporting, often in `quarto` or `rmarkdown`.
A simple example is to create a list of tables with each number of cylinders
grouped together.
```{r example-setup}
d_tab <-
mtcars %>%
tidyr::nest(table = !"cyl") %>%
dplyr::mutate(
caption = glue::glue("Cars with {cyl} cylinders")
) %>%
new_tab_tibble()
```
Then, print it! You must set `results='asis'` for the chunk printing your
`tab_tibble`.
```{r print, results='asis'}
knit_print(d_tab)
```