From andy_liaw at merck.com  Sun Jun 12 21:08:56 2005
From: andy_liaw at merck.com (Liaw, Andy)
Date: Sun, 12 Jun 2005 15:08:56 -0400
Subject: [Rd] by should use match.fun
Message-ID: <39B6DDB9048D0F4DAD42CB26AAFF0AFA64E98E@usctmx1106.merck.com>

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 at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 
>



[Rd] by should use match.fun
Liaw, Andy