aggregate_col: Aggregate 'zoocat' objects by column attributes

Description Usage Arguments Value Examples

Description

Aggregate columns of a "zoocat" object by given column attributes fields.

Usage

1
aggregate_col(x, by = colnames(cattr(x)), FUN = mean, ...)

Arguments

x

a "zoocat" object.

by

a character string indicates the field of column attributes.

FUN

a function to be applied to all data subsets.

...

additional arguments to be passed to the method.

Value

a "zoocat" object.

Examples

1
2
3
4
5
6
# This is the air quality example from package reshape2
names(airquality) <- tolower(names(airquality))
aqm <- melt(airquality, id = c("month", "day"), na.rm=TRUE) 
zc <- cast2zoocat(aqm, index.var = 'month', value.var = 'value', fun.aggregate = mean) 
aggregate_col(zc, by = 'variable', FUN = max)
aggregate_col(zc, by = 'variable', FUN = max, na.rm = TRUE)

zoocat documentation built on May 2, 2019, 10:22 a.m.