Skip to contents

as.data.frame() returns the table table_battery() displays, with its numbers: exactly what output = "data.frame" returns. One row per item, with the columns variable (the item's column), label (the label displayed), then the printed columns under their names (one per level shown, "(Missing)", the summary column of top, "n", each prefixed with its group under by, then "p"). The "note" attribute is kept. 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_battery_table'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

# S3 method for class 'spicy_battery_table'
as_tibble(x, ...)

# S3 method for class 'spicy_battery_svy_table'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

# S3 method for class 'spicy_battery_svy_table'
as_tibble(x, ...)

Arguments

x

A spicy_battery_table returned by table_battery(), or a spicy_battery_svy_table returned by table_battery_svy().

row.names, optional

Standard base::as.data.frame() arguments, currently ignored.

...

Further arguments passed to tibble::as_tibble() (for the tibble method) or ignored.

Value

A plain data.frame (or tbl_df), identical to the output = "data.frame" of the same call.