crunch (version 1.27.7)

crtabs: Crunch xtabs: Crosstab and otherwise aggregate variables in a Crunch Dataset

Description

Create a contingency table or other aggregation from cross-classifying variables in a CrunchDataset.

Usage

crtabs(
  formula,
  data,
  weight = crunch::weight(data),
  useNA = c("no", "ifany", "always")
)

Arguments

formula

an object of class 'formula' object with the cross-classifying variables separated by '+' on the right side of the "~". If aggregating by functions other than counts, include the aggregation expression on the left-hand side. Compare to stats::xtabs().

data

an object of class CrunchDataset

weight

a CrunchVariable that has been designated as a potential weight variable for data, or NULL for unweighted results. Default is the currently applied weight().

useNA

whether to include missing values in tabular results. See base::table().

Value

an object of class CrunchCube

See Also

weight()