From ggrothendieck at gmail.com  Tue Jun 14 14:08:06 2005
From: ggrothendieck at gmail.com (ggrothendieck@gmail.com)
Date: Tue, 14 Jun 2005 14:08:06 +0200 (CEST)
Subject: [Rd] by should use match.fun (PR#7936)
Message-ID: <20050614120806.67D04EC6D@slim.kubism.ku.dk>

Full_Name: G. Grothendieck
Version: R version 2.1.0, 2005-06-10
OS: Windows XP
Submission from: (NULL) (216.59.226.184)



This is an inconsistency between by and similar functions.  
The 'by' function should have an initial line of:

FUN <- match.fun(FUN)

All other similar functions including apply, sapply,
tapply, lapply work like that so 'by' ought to as well.  

Here is an example using the 'iris' data set.  Suppose we 
wish to create a list of rows:

by(iris, row.names(iris), "(")

In every other similar function "(" would have been interpreted
as the intended function but here we get an error that it cannot
find "(".  Although such an error is not inconsistent with the
documentation it would seem to violate the consistency of the
R base functions mentioned.

There was a discussion of this on r-devel in this thread:

https://www.stat.math.ethz.ch/pipermail/r-devel/2005-June/033583.html



[Rd] by should use match.fun (PR#7936)
ggrothendieck@gmail.com