tbl_start: Table Initialization

View source: R/tbl_start.R

tbl_startR Documentation

Table Initialization

Description

Initializes a tangram.pipe table by specifying the desired elements and data components.

Usage

tbl_start(
  data,
  col_var,
  missing = FALSE,
  overall = TRUE,
  comparison = FALSE,
  digits = 2,
  default_num_summary = num_default,
  default_cat_summary = cat_default,
  default_binary_summary = binary_default
)

Arguments

data

The dataset to be used in the table.

col_var

The variable to be used in the table columns. NULL if single summary column desired.

missing

logical: if TRUE, missing data is considered; FALSE only uses complete cases.

overall

logical: if TRUE, an overall column is included.

comparison

logical: if TRUE, a comparison test is conducted between columns.

digits

The default number of digits to use in the table. By default, the package will use 2 significant digits.

default_num_summary

The default summary function to use for numerical rows. By default, the package will use num_default(), but the user can also choose num_minmax, num_medianiqr, num_mean_sd, or write a custom function to use for the rows.

default_cat_summary

The default summary function to use for categorical rows. By default, the package will use cat_default(), but the user can also choose cat_pct or write a custom function to use for the rows.

default_binary_summary

The default summary function to use for binary rows. By default, the package will use binary_default(), but the user can also choose binary_pct or write a custom function to use for the rows.

Value

A list containing separate entries holding information provided in the function's arguments, as well as a calculated number of column categories to include for the initialized table.

Examples

x <- tbl_start(iris, "Species", missing=TRUE, overall=TRUE, comparison=TRUE)

tangram.pipe documentation built on Aug. 18, 2022, 1:06 a.m.