search for: stat_fun

Displaying 1 result from an estimated 1 matches for "stat_fun".

Did you mean: stat_func
2013 Jan 17
3
how to use "..."
...e "...". I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a integer vector defining which columns of the data.frame should be use on the right side of the formula # 'stat_fun' is the function that will be run to aggregate stat.group <- function(dat, vec_cat, stat_fun){ require(doBy) df <- summaryBy(as.formula(paste0(".~",paste0(names(dat)[vec_cat],collapse="+"))), data=dat, FUN=stat_fun) return(df) } Example, works fine: m...