[Rd] matrixStats: Extend to arrays too (Was: Re: Suggestion: Adding quick rowMin and rowMax functions to base package)
hb at biostat.ucsf.edu
Tue Feb 15 19:11:46 CET 2011
On Sun, Feb 13, 2011 at 10:18 AM, TakeoKatsuki <takeo.katsuki at gmail.com> wrote:
> Hi Henrik,
> It would be nice if functions of the matrixStats package can handle array
> For example, rowSums() of the base package sums along the third axis of an
> array by rowSums(x, dim=2).
That is a good idea. This was indeed the initial objective before
starting matrixStats. After debating (mostly with myself) on what a
consistent and solid API for arrays would look like I decided to
postpone that and just focus on matrices (the more immediate need).
A well-designed API generalized to work with arrays should probably
borrow ideas from how argument 'MARGIN' of apply() works, how argument
'dim' in rowSums() for (though I must say the letter seem a bit ad hoc
at first sight given the name of the function). There may also be
something to learn from the 'reshape' package and so.
Having said this, code contributions toward an array-based API are
appreciated. As a start it may be better to make the extension
independent of the existing matrix-based API, at least before a solid
array-based API has been settled.
More information about the R-devel