
Last chance! 50% off unlimited learning
Sale ends in
zoocat
objects by column attributesAggregate columns of a "zoocat
" object by given column attributes fields.
aggregate_col(x, by = colnames(cattr(x)), FUN = mean, ...)
a "zoocat
" object.
a character string indicates the field of column attributes.
a function to be applied to all data subsets.
additional arguments to be passed to the method.
a "zoocat
" object.
# 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