binary_row: Binary Row

View source: R/binary_row.R

binary_rowR Documentation

Binary Row

Description

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

Usage

binary_row(
  list_obj,
  row_var,
  col_var = NULL,
  newdata = FALSE,
  ref.label = "on",
  rowlabel = NULL,
  summary = NULL,
  reference = NULL,
  compact = TRUE,
  missing = NULL,
  overall = NULL,
  comparison = NULL,
  digits = 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.

ref.label

toggles the reference label in the table. Default is on, which displays the reference; off switches it off. Only relevant if a compact row is used.

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.

reference

the name of the row category to use as the reference. Default will use alphabetical first category.

compact

logical: if TRUE, data displayed in one row.

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.

indent

number of spaces to indent category names.

Value

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

See Also

Possible summary functions for binary data:binary_default, binary_pct, binary_count, binary_jama

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

Starting a tangram.pipe table: tbl_start

Examples

iris$color <- sample(c("Blue", "Purple"), size=150, replace=TRUE)
x <- tbl_start(iris, "Species", missing=TRUE, overall=TRUE, comparison=TRUE) %>%
  binary_row("color", rowlabel="Color")

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