cube-computing | R Documentation |
These functions provide an interface like base::margin.table()
and
base::prop.table()
for the CrunchCube object. CrunchCubes
contain richer metadata than standard R array
objects, and they also conceal certain
complexity in the data structures from the user. In particular,
multiple-response variables are generally represented as single dimensions in
result tables, but in the actual data, they may comprise two dimensions.
These methods understand the subtleties in the Crunch data types and
correctly compute margins and percentages off of them.
margin.table(x, margin = NULL)
prop.table(x, margin = NULL)
bases(x, margin = NULL)
## S4 method for signature 'CrunchCube'
prop.table(x, margin = NULL)
## S4 method for signature 'CrunchCube'
round(x, digits = 0)
## S4 method for signature 'CrunchCube'
bases(x, margin = NULL)
## S4 method for signature 'CrunchCube'
margin.table(x, margin = NULL)
## S4 method for signature 'MultitableResult'
prop.table(x, margin = NULL)
## S4 method for signature 'TabBookResult'
prop.table(x, margin = NULL)
## S4 method for signature 'TabBookResult'
bases(x, margin = NULL)
## S4 method for signature 'MultitableResult'
bases(x, margin = NULL)
x |
a CrunchCube |
margin |
index, or vector of indices to generate margin for. See
|
digits |
For |
These functions also generalize to MultitableResults and TabBookResults,
which are returned from a tabBook()
request. When called on one of those
objects, they effectively apply over each CrunchCube contained in them.
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.
When called on CrunchCubes, these functions return an array
.
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 lists of prop.tables.
margin.table()
prop.table()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.