Description Usage Arguments Value Note Author(s) See Also Examples
Aggregates data by cross-classifying factors, with a formula interface similar to xtabs
1 2 |
data |
a "ddf" containing the variables in the formula |
formula |
a |
by |
an optional variable name or vector of variable names by which to split up tabulations (i.e. tabulate independently inside of each unique "by" variable value). The only difference between specifying "by" and placing the variable(s) in the right hand side of the formula is how the computation is done and how the result is returned. |
output |
"kvConnection" object indicating where the output data should reside in the case of |
preTransFn |
an optional function to apply to each subset prior to performing tabulation. The output from this function should be a data frame containing variables with names that match that of the formula provided. Note: this is deprecated - instead use |
maxUnique |
the maximum number of unique combinations of variables to obtain tabulations for. This is meant to help against cases where a variable in the formula has a very large number of levels, to the point that it is not meaningful to tabulate and is too computationally burdonsome. If |
params |
a named list of objects external to the input data that are needed in the distributed computing (most should be taken care of automatically such that this is rarely necessary to specify) |
packages |
a vector of R package names that contain functions used in |
control |
parameters specifying how the backend should handle things (most-likely parameters to |
a data frame of the tabulations. When "by" is specified, it is a ddf with each key-value pair corresponding to a unique "by" value, containing a data frame of tabulations.
The interface is similar to xtabs
, but instead of returning a full contingency table, data is returned in the form of a data frame only with rows for which there were positive counts. This result is more similar to what is returned by aggregate
.
Ryan Hafen
1 | drAggregate(Sepal.Length ~ Species, data = ddf(iris))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.