Skip to contents

Build a tabxplor_tab around fmt columns

Usage

new_tab(
  tabs = tibble::tibble(),
  subtext = "",
  test = new_test_tibble(),
  chi2 = NULL,
  meta = NULL,
  ...,
  class = character()
)

new_grouped_tab(
  tabs = tibble::tibble(),
  groups,
  subtext = "",
  test = new_test_tibble(),
  chi2 = NULL,
  meta = NULL,
  ...,
  class = character()
)

Arguments

tabs

A table, stored into a tibble data.frame. It is generally made with tab, tab_reg or tab_plain.

subtext

A character vector to print legend lines under the table.

test

A tidy tibble storing whole-table test results (Chi2 for factor columns, ANOVA F for mean columns), filled by tab_chi2.

chi2

[Deprecated] Soft-deprecated alias of test.

meta

The table's metadata, as a single named list gathering (all optional, NULL when unset):

  • render_extras – display-only intent for the base count and the add_pct companion, list(n =, add_pct =), materialised at print/export time from this attribute rather than baked into the table.

  • spec – the table's identity, list(kind =, vars =, call =): its kind ("crosstab" or "regression"); vars, what no column can carry (list(wt =, caption =, outcomes =, var_labels =) – see set_caption), the rest of the variable model being derived from the declared index columns and from the columns' own col_var; and call, the producer's own recipe (a regression's model record – family, outcome, predictors, reference level, and the fit_spec reg_check_plots refits from).

  • empirical_tips – multinomial crude-companion tooltip data (a tibble keyed by column, predictor and level), set by tab_reg(empirical = TRUE).

  • assumptions – one record PER OUTCOME, keyed by it, each holding the observed curve of every continuous predictor (weighted quantile bins of the outcome on the family's link scale, one block per tab_vars group), set by tab_reg: the data behind the sparkline – drawn in a continuous predictor's n cell, or in the shape table below the footer – and behind reg_check_plots's linearity panel.

  • color_breaks – a per-table override of the colour break scales (see set_color_breaks), merged over the global option at render time.

meta sub-fields left NULL are dropped, so a table given nothing carries no attribute.

...

Needed to implement subclasses.

class

Needed to implement subclasses.

groups

The grouping data.

Value

A tibble of class tabxplor_tab.

A tibble of class tabxplor_grouped_tab.