[Rd] rowsum() may return a vector instead of a matrix (PR#3737)

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Aug 13 07:13:40 MEST 2003


On Tue, 12 Aug 2003, Thomas Lumley wrote:

> On Wed, 13 Aug 2003 brahm at alum.mit.edu wrote:
> 
> > If all rows are in the same "group", rowsum() returns a vector instead of a
> > (1xN) matrix, contrary to documentation:
> >
> 
> Yes, and it appears to be deliberate since rowsum.default() ends with
> drop(rval), though I don't remember why it was this way.
> 
> Is there a strong preference for changing the function vs changing the
> documentation?

I'd change the function.  The Therneau original function of this name 
returns a 1xN matrix, and it is easier to drop() that to reinstate.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list