Coerce a spicy_outcome_table to a plain data frame or tibble
Source: R/table_outcome_print.R
as.data.frame.spicy_outcome_table.Rdas.data.frame() returns the table table_outcome() displays, with
its numbers: exactly what output = "data.frame" returns. One row per
printed row – the Overall row, then for each grouping its header
row, which carries the block's comparison, and its levels – with the
key columns variable (the outcome on the Overall row, the
grouping elsewhere), label, level and .row_role ("summary",
"factor_header", "level", or "missing"), then the printed
columns under their names ("M", "SD", ..., "n", "p"). A cell
that prints several numbers keeps the others beside it, as in
as.data.frame.spicy_continuous_table(). The note, as printed, is
kept in attr(, "note"). as_tibble() returns the same table as a
tibble. The original x is unaffected, and print(x) continues to
render the formatted table.
Usage
# S3 method for class 'spicy_outcome_table'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
# S3 method for class 'spicy_outcome_table'
as_tibble(x, ...)Arguments
- x
A
spicy_outcome_tablereturned bytable_outcome().- row.names, optional
Standard
base::as.data.frame()arguments, currently ignored.- ...
Further arguments passed to
tibble::as_tibble()(for the tibble method) or ignored.
Details
For every statistic the table computes, use output = "long" or
tidy.spicy_outcome_table().