From ripley at stats.ox.ac.uk  Wed Aug 13 07:13:40 2003
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed Aug 13 07:17:35 2003
Subject: [Rd] rowsum() may return a vector instead of a matrix (PR#3737)
In-Reply-To: <Pine.A41.4.44.0308121653290.63600-100000@homer40.u.washington.edu>
Message-ID: <Pine.LNX.4.44.0308130612180.5075-100000@gannet.stats>

On Tue, 12 Aug 2003, Thomas Lumley wrote:

> On Wed, 13 Aug 2003 brahm@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@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


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