[Rd] by should use match.fun
andy_liaw at merck.com
Sun Jun 12 21:08:56 CEST 2005
I don't get the point. ?by says:
FUN a function to be applied to data frame subsets of data.
It doesn't say FUN can be a character, and by(iris, iris$Species, summary)
works as expected.
> From: Gabor Grothendieck
> I noticed that, unlike similar functions, 'by' does not use
> match.fun, e.g.
> > by(iris, iris$Species, "summary")
> Error in FUN(X[], ...) : couldn't find function "FUN"
> The 'by' code should have an initial line of:
> FUN <- match.fun(FUN)
> R-devel at r-project.org mailing list
More information about the R-devel