Skip to content
humanpredPublic

About

Simplify Reporting Many Tables

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Repository files navigation

tabtibble

R-CMD-check Codecov test coverage

The goal of tabtibble is to simplify printing many tables in reports typically created with quarto or rmarkdown.

Installation

You can install the development version of tabtibble like so:

remotes::install_github("humanpred/tabtibble")

Example

This is a basic example which shows you how to solve a common problem:

library(tabtibble)
my_tt <- new_tab_tibble(tibble::tibble(table = list(data.frame(a = 1)), caption = "foo"))
knit_print(my_tt)
a
1

foo

No results='asis' chunk option is needed: by default (tabtibble.knitr.auto.asis, TRUE), knit_print() returns knitr::asis_output(), the same mechanism pander uses for its knitr.auto.asis option. Set options(tabtibble.knitr.auto.asis = FALSE) to opt out and write directly with cat() instead (which does need results='asis').

Quarto + Typst reports

Each table is wrapped in a fenced Div with a Quarto label (#tbl-<label>), derived automatically from its caption when not supplied, so it can be cross-referenced with @tbl-<label> and appears in a Typst list of tables when the report is rendered to a Typst PDF. Tables can be rendered as Markdown (the default, no extra dependency), or with tinytable, gt, flextable, or natively in typst (which also supports topic-grouped listings, reproducing LaTeX’s TopicLongTable – a group value is printed once, above its rows, and repeats at the top of each page the group continues onto) via the tabtibble.backend option. See vignette("example-usage", package = "tabtibble") for details.

About

Simplify Reporting Many Tables

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages