From brahm at alum.mit.edu  Wed Aug 13 10:38:50 2003
From: brahm at alum.mit.edu (David Brahm)
Date: Wed Aug 13 15:38:25 2003
Subject: [Rd] rowsum() may return a vector instead of a matrix (PR#3737)
References: <200308122205.h7CM5sJH026811@pubhealth.ku.dk>
	<Pine.A41.4.44.0308121653290.63600-100000@homer40.u.washington.edu>
Message-ID: <16186.16234.399615.449609@arbres1a.fmr.com>

I wrote:
> If all rows are in the same "group", rowsum() returns a vector instead of a
> (1xN) matrix, contrary to documentation:

Thomas Lumley <tlumley@u.washington.edu> replied:
> Is there a strong preference for changing the function vs changing the
> documentation?

I could live with it either way, but I will point out that the "Examples"
section implies an equivalence between:
  R> xsum <- rowsum(x, group)
and
  R> xsum2 <- tapply(x, list(group[row(x)], col(x)), sum)
  R> xsum3 <- aggregate(x, list(group), sum)
which is broken by this new behavior; xsum2 and xsum3 are (1xN) matrices.
-- 
                              -- David Brahm (brahm@alum.mit.edu)


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