Skip to contents

Returns a matrix of formats for the cells in a table.

Usage

value_formats(obj, default = obj_format(obj))

# S4 method for class 'ANY'
value_formats(obj, default = obj_format(obj))

# S4 method for class 'TableRow'
value_formats(obj, default = obj_format(obj))

# S4 method for class 'LabelRow'
value_formats(obj, default = obj_format(obj))

# S4 method for class 'VTableTree'
value_formats(obj, default = obj_format(obj))

Arguments

obj

(VTableTree or TableRow)
a table or row object.

default

(string, function, or list)
default format.

Value

Matrix (storage mode list) containing the effective format for each cell position in the table (including 'virtual' cells implied by label rows, whose formats are always NULL).

See also

table_shell() and table_shell_str() for information on the table format structure.

Examples

lyt <- basic_table() %>%
  split_rows_by("RACE", split_fun = keep_split_levels(c("ASIAN", "WHITE"))) %>%
  analyze("AGE")

tbl <- build_table(lyt, DM)
value_formats(tbl)
#>       all obs
#> ASIAN NULL   
#> Mean  "xx.xx"
#> WHITE NULL   
#> Mean  "xx.xx"