Skip to contents

Extracts the data frame stored in the fr_spec object. This is the same data frame passed to fr_table() or fr_listing(), before any rendering transformations (sorting, repeat suppression, blank-after rows).

Modifying the returned data frame does not affect the spec (R copy-on-modify semantics protect the original).

Usage

fr_get_data(spec)

Arguments

spec

An fr_spec object from fr_table() or fr_listing().

Value

A data frame. For figure specs created by fr_figure(), returns an empty data frame with zero rows and zero columns.

See also

fr_table(), fr_listing(), fr_get_columns() for column configuration.

Examples

spec <- tbl_demog |> fr_table()
d <- fr_get_data(spec)
nrow(d)
#> [1] 28
names(d)
#> [1] "characteristic" "placebo"        "zom_50mg"       "zom_100mg"     
#> [5] "total"          "group"