as.data.frame.gridtable: Coerce a gridtable to a Calibrated Data Frame

View source: R/gridtable.R

as.data.frame.gridtableR Documentation

Coerce a gridtable to a Calibrated Data Frame

Description

Parse a validated gridtable object directly to a calibrated data frame. Columns have width attributes suggested by the grid table spans. Continuation lines within a grid-table cell are collapsed with single spaces. Cell markup is otherwise left untouched for downstream renderers.

Usage

## S3 method for class 'gridtable'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  ...,
  scale = getOption("tablet.gridtable.scale", 1)
)

Arguments

x

Character scalar with class gridtable.

row.names

Optional row names for the returned data frame.

optional

Currently unused; accepted for compatibility with as.data.frame.

...

Currently unused.

scale

Numeric scalar multiplier applied to grid-table dash counts when deriving column-level width attributes.

Value

A data frame with class c("calibrated", "data.frame"). Each column has a width attribute derived from the final grid table dash count multiplied by scale and encoded as an em width.

See Also

as_gridtable.character, as_calibrated.data.frame

Other gridtable: as_calibrated(), as_calibrated.data.frame(), as_gridtable(), as_gridtable.character(), as_gridtable.data.frame(), kbl(), kbl.calibrated(), kbl.default(), kbl.gridtable(), print.gridtable()


tablet documentation built on July 19, 2026, 9:06 a.m.