Re: [Rd] by should use match.fun

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Sun 12 Jun 2005 - 19:08:56 GMT


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.

Andy

> 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[[1]], ...) : couldn't find function "FUN"
>
> The 'by' code should have an initial line of:
>
> FUN <- match.fun(FUN)
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>
>



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon Jun 13 05:12:44 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:09 GMT