Crunch.io supports more complex data types than base R does, such as
multiple response and array types. If you want to compute margin or
proportion tables on an aggregation of these variable types, special methods
are required. These functions provide an interface like
margin.table
and prop.table
for
the CrunchCube object, handling those special data types.
# S4 method for CrunchCube
margin.table(x, margin = NULL)# S4 method for CrunchCube
prop.table(x, margin = NULL)
# S4 method for CrunchCube
round(x, digits = 0)
# S4 method for CrunchCube
bases(x, margin = NULL)
# S4 method for MultitableResult
prop.table(x, margin = NULL)
# S4 method for TabBookResult
prop.table(x, margin = NULL)
# S4 method for TabBookResult
bases(x, margin = NULL)
# S4 method for MultitableResult
bases(x, margin = NULL)
a CrunchCube
index, or vector of indices to generate margin for. See
prop.table
. bases
accepts an additional valid
value for margin
, 0
, which yields the unweighted counts for the
query, without reducing dimension.
see round
The appropriate margin.table or prop.table. Calling prop.table on a MultitableResult returns a list of prop.tables of the CrunchCubes it contains. Likewise, prop.table on a TabBookResult returns a list of list of prop.tables.
bases
is an additional method for CrunchCubes. When making weighted
requests, bases
allows you to access the unweighted counts for every
cell in the resulting table (array). The bases
function takes a
"margin" argument to work like margin.table
, or with margin=0
gives all cell counts.