> I would think that something like this would fix it up, but no dice: > > cast(scores.melt, grade ~ variable, fun.aggregate = c(mean, num.neg = > function(x) sum(x < 0))) > > that is, why not look at names(fun.aggregate)? or am I missing something?
Yes, that's a bug in each (the function which turns a vector of functions into a function that returns a named vector of outputs). I've added a note to my to do. In the meantime, you can do: num.neg <- function(x) sum(x < 0) cast(scores.melt, grade ~ variable, fun.aggregate = c(mean, num.neg)) Hadley -- http://had.co.nz/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.