matrixStats: Extend to arrays too (Was: Re: Suggestion: Adding quick rowMin and rowMax functions to base package)
-----Original Message----- From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-project.org] On Behalf Of Hadley Wickham Sent: Wednesday, February 16, 2011 7:32 AM To: Tim Hesterberg Cc: Henrik Bengtsson; r-devel at r-project.org Subject: Re: [Rd] matrixStats: Extend to arrays too (Was: Re: Suggestion: Adding quick rowMin and rowMax functions to base package) On Wed, Feb 16, 2011 at 2:48 PM, Tim Hesterberg <timhesterberg at gmail.com> wrote:
For consistency with rowSums colSums rowMeans etc., the
names should be
? ? ? ?colMins colMaxs ? ? ? ?rowMins rowMaxs This is also consistent with S+.
You mean rowMaxes, right? Or is the rule to add an s, not to pluralise?
In S+ we chose to just append the 's' instead of making
everyone worry about the vagarities of English spelling
and pluralization rules. We also have 'groupAnys' and
'igroupAnys' (and should have {row,col}Anys, but we don't).
The 'igroup<Summarys>' family of functions in S+ is to the
'group<Summarys>' family as 'tabulate' is to 'table': it
requires that the grouping variable be an integer in the
range 1:numGroups and in return gives fast results.
Having a similar family of functions for general arrays
would be nice also, but I think that specialized row* and col*
functions are good to have: data.frames only have rows and
columns and I can never remember the MARGIN number conventions
of apply and sweep.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
I think if you were writing a new package, you'd be better off a whole new naming convention that extended better to higher dimensions. Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel