roff_table: A data frame as a tbl table

View source: R/knitroff.R

roff_tableR Documentation

A data frame as a tbl table

Description

Returns troff for the tbl preprocessor, a centred, boxed table with a bold header and numeric columns aligned, to be set when the document goes through groff -t (which render_roff does). Make it the value of a chunk.

Usage

roff_table(x, caption = NULL, digits = getOption("digits"))

Arguments

x

A data frame or matrix.

caption

Optional caption, set in bold, centred above the table.

digits

Significant digits for numeric columns.

Value

Troff text marked to go into the document as is.

Examples

cat(roff_table(head(mtcars[, 1:3]), caption = "Three columns of mtcars"))

knitroff documentation built on Oct. 16, 2026, 5:09 p.m.