td.tapply: Apply a function over a database column

Description Usage Arguments Value Examples

View source: R/td.tapply.R

Description

Apply a function to each column value, that is to each (non-empty) group of values given by a unique combination of the levels of certain factors.

Usage

1
td.tapply(X, INDEX, FUN = NULL, asdf = FALSE, ...)

Arguments

X

td data frame of column to apply function to.

INDEX

td data frame of the list of columns, each in same table as X.

FUN

One of the following functions to be applied (sum, min, max, mean, td.values, and td.stats).

asdf

If TRUE, the return value is left as a data frame object. Otherwise default is as an array.

...

forward information.

Value

Array dimensioned by the INDEX containing the result of applying FUN to the data. If asdf = TRUE the result will instead be a data frame of the results.

Examples

1
2
3
4
## Not run: 
td.tapply(tdf["income"], tdf["gender"], td.stats)

## End(Not run)

nonsleepr/teradataR documentation built on May 23, 2019, 9:32 p.m.