brdg_hierarchical {gtsummary}R Documentation

Hierarchy table bridge

Description

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_*()⁠.

Usage

brdg_hierarchical(
  cards,
  variables,
  by,
  include,
  statistic,
  overall_row,
  count,
  is_ordered,
  label
)

pier_summary_hierarchical(cards, variables, include, statistic)

Arguments

cards

(card)
an ARD object of class "card" created with cards::ard_hierarchical_stack().

variables

(character)
character list of hierarchy variables.

by

(string)
string indicating the stratifying column.

include

(character)
character list of hierarchy variables to include summary statistics for.

statistic

(named list)
named list of summary statistic names.

overall_row

(scalar logical)
whether an overall summary row should be included at the top of the table. The default is FALSE.

count

(scalar logical)
whether tbl_hierarchical_count() (TRUE) or tbl_hierarchical() (FALSE) is being applied.

is_ordered

(scalar logical)
whether the last variable in variables is ordered.

label

(named list)
named list of hierarchy variable labels.

Value

a gtsummary object

See Also

Review list, formula, and selector syntax used throughout gtsummary


[Package gtsummary version 2.2.0 Index]