Skip to content
Prev 10236 / 63424 Next

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

I wrote:
Thomas Lumley <tlumley@u.washington.edu> replied:
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.