Discrete data summary in long format

pt_cat_long(
  data,
  cols,
  span = ".total",
  all_name = " ",
  all_name_span = "Summary",
  summarize = c("both", "right", "top", "none"),
  table = NULL,
  by = NULL
)

Arguments

data

the data frame to summarize; the user should filter or subset so that data contains exactly the records to be summarized; pmtables will not add or remove rows prior to summarizing data

cols

the columns to summarize; may be character vector or quosure

span

variable name for column spanner

all_name

a name to use for the complete data summary

all_name_span

table column name to use for data summaries across levels of span if it is provided

summarize

where to include a data summary across subgroups; use none to drop the summary from the table

table

a named list to use for renaming columns (see details and examples)

by

use span argument instead

Value

An object with class pmtable; see class-pmtable.

Details

The data summary for all cells in the table is count (percent).

The notes in this table are generated with pt_cat_long_notes().

Examples


out <- pt_cat_long(pmt_first, cols = "SEXf,ASIANf", span = "FORMf")

if (FALSE) {
st2report(stable(out))
}