Bug 7936 - by should use match.fun
Summary: by should use match.fun
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Wishlist (show other bugs)
Version: old
Hardware: ix86 (32-bit) Windows 32-bit
: P5 normal
Assignee: Jitterbug compatibility account
URL:
Depends on:
Blocks:
 
Reported: 2005-06-14 17:07 UTC by Jitterbug compatibility account
Modified: 2005-06-14 17:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2005-06-14 17:07:58 UTC
From: ggrothendieck@gmail.com
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

Comment 1 Jitterbug compatibility account 2005-06-15 16:01:00 UTC
NOTES:
 Says one user, despite lack of unanimity on R-devel, and
definite statements that this is not an actual bug.
Comment 2 Jitterbug compatibility account 2005-06-15 18:00:41 UTC
Audit (from Jitterbug):
Wed Jun 15 13:00:41 2005	ripley	changed notes
Wed Jun 15 13:00:41 2005	ripley	moved from incoming to wishlist