From ggrothendieck at gmail.com  Sun Jun 12 21:37:23 2005
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Sun, 12 Jun 2005 15:37:23 -0400
Subject: [Rd] by should use match.fun
In-Reply-To: <71D65BAB-A619-4F24-8EBA-DAA15B4ADCD2@r-project.org>
References: <39B6DDB9048D0F4DAD42CB26AAFF0AFA64E98E@usctmx1106.merck.com>
	<971536df050612122118e55e2f@mail.gmail.com>
	<71D65BAB-A619-4F24-8EBA-DAA15B4ADCD2@r-project.org>
Message-ID: <971536df05061212375bc4e7a3@mail.gmail.com>

On 6/12/05, Simon Urbanek <simon.urbanek at r-project.org> wrote:
> On Jun 12, 2005, at 3:21 PM, Gabor Grothendieck wrote:
> 
> > On 6/12/05, Liaw, Andy <andy_liaw at merck.com> wrote:
> >
> >> I don't get the point.  ?by says:
> >>
> >
> > The point is that all other functions of this sort including apply,
> > sapply,
> > tapply, lapply work like that so 'by' ought to as well.
> >
> > Here is the example (changed to use iris) where I noticed it.
> > Suppose we
> > want to create a list of rows:
> >
> > by(iris, row.names(iris), "(")
> 
> Umm.. why don't you just use
> 
> by(iris, row.names(iris), `(`)
> 
> In general I consider passing functions as text unnecessary - the
> only use I could think of is constructing function names from strings/
> data and I'm not sure that is a good idea, either (it causes quite
> some performance issues) ... just my 2 pennies ...

That's a good idea and I will change my code accordingly although it does 
not change the fact that an inconsistency remains and should be
corrected.



[Rd] by should use match.fun
Gabor Grothendieck