View source: R/brdg_hierarchical.R
brdg_hierarchical | R Documentation |
Bridge function for converting tbl_hierarchical()
(and similar) cards to basic gtsummary objects.
All bridge functions begin with prefix brdg_*()
.
This file also contains helper functions for constructing the bridge,
referred to as the piers (supports for a bridge) and begin with pier_*()
.
brdg_hierarchical()
: The bridge function ingests an ARD data frame and returns
a gtsummary table that includes .$table_body
and a basic .$table_styling
.
The .$table_styling$header
data frame includes the header statistics.
Based on context, this function adds a column to the ARD data frame named
"gts_column"
. This column is used during the reshaping in the pier_*()
functions defining column names.
pier_*()
: these functions accept a cards tibble and returns a tibble
that is a piece of the .$table_body
. Typically these will be stacked
to construct the final table body data frame. The ARD object passed here
will have two primary parts: the calculated summary statistics and the
attributes ARD. The attributes ARD is used for labeling. The ARD data frame
passed to this function must include a "gts_column"
column, which is
added in brdg_hierarchical()
.
brdg_hierarchical(
cards,
variables,
by,
include,
statistic,
type,
overall_row,
count,
is_ordered,
label
)
pier_summary_hierarchical(cards, variables, include, statistic)
cards |
( |
variables |
( |
by |
( |
include |
( |
statistic |
(named |
type |
(named |
overall_row |
(scalar |
count |
(scalar |
is_ordered |
(scalar |
label |
(named |
a gtsummary object
Review list, formula, and selector syntax used throughout gtsummary
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.