Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


zoocat (version 0.2.0.1)

aggregate_col: Aggregate zoocat objects by column attributes

Description

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

Usage

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

Run this code
# NOT RUN {
# 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)

# }

Run the code above in your browser using DataLab