cat_row: Categorical Row

View source: R/cat_row.R

cat_rowR Documentation

Categorical Row

Description

Adds in a categorical row to a tangram.pipe table.

Usage

cat_row(
  list_obj,
  row_var,
  col_var = NULL,
  newdata = FALSE,
  rowlabel = NULL,
  summary = NULL,
  missing = NULL,
  overall = NULL,
  comparison = NULL,
  digits = NULL,
  ordering = "none",
  sortcol = NULL,
  indent = 5
)

Arguments

list_obj

the name of the tbl_start object previously initialized.

row_var

the name of the variable to be used in the rows.

col_var

the variable to be used in the table columns. Default is from initialized tbl_start object.

newdata

enter new dataset name if different from that initialized in tbl_start.

rowlabel

the label for the table row name, if different from row_var.

summary

summary function for the data, if different from the one supplied in tbl_start.

missing

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

overall

logical: if TRUE, an overall column is included.

comparison

the name of the comparison test to use, if different from that initialized in tbl_start.

digits

significant digits to use.

ordering

If ascending, will sort by overall ascending order; if descending, will sort by overall descending order. Default is no row sorting.

sortcol

Column to sort row on. Requires ordering to be ascending or descending. By default, will sort based on overall statistics.

indent

number of spaces to indent category names.

Value

A list with the categorical row's table information added as a new element to list_obj.

See Also

Possible summary functions for categorical data:cat_default, cat_pct, cat_count, cat_jama

Other related row-building functions: num_row, binary_row, n_row, empty_row

Starting a tangram.pipe table: tbl_start

Examples

iris$Stem.Size <- sample(c("Small", "Medium", "Medium", "Large"), size=150, replace=TRUE)
x <- tbl_start(iris, "Species", missing=TRUE, overall=TRUE, comparison=TRUE) %>%
  cat_row("Stem.Size", rowlabel="Stem Size")

thomasgstewart/tangram.pipe documentation built on Aug. 18, 2022, 8:41 p.m.