table0: Version of 'table' with better defaults

table0R Documentation

Version of table with better defaults

Description

First, table0 is a version of table() in base R that automatically supplies useNA = "always". See that function for documentation. Second, table1 is a wrapper for table0 that takes a single vector and automatically returns the proportions (rather than frequencies) and rounds these to two digits.

Usage

table0(
  ...,
  exclude = if (useNA == "no") c(NA, NaN),
  useNA = c("no", "ifany", "always"),
  dnn = list.names(...),
  deparse.level = 1
)

Examples

table0(mtcars$cyl, mtcars$gear)

# note that table1 only takes one argument, a vector
table1(mtcars$gear)

wepelham3/sack2 documentation built on Aug. 5, 2023, 5:53 a.m.