Re: [Rd] by should use match.fun

From: Simon Urbanek <simon.urbanek_at_r-project.org>
Date: Sun 12 Jun 2005 - 19:32:02 GMT

On Jun 12, 2005, at 3:21 PM, Gabor Grothendieck wrote:

> On 6/12/05, Liaw, Andy <andy_liaw@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 ...

Cheers,
Simon



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

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