From hpages at fhcrc.org  Thu Jul 17 07:48:00 2008
From: hpages at fhcrc.org (Herve Pages)
Date: Wed, 16 Jul 2008 22:48:00 -0700
Subject: [Rd] rowSums()/colSums() don't preserve the 'integer' storage mode
Message-ID: <487EDD10.8020907@fhcrc.org>

Hi,

Wouldn't that make sense to have rowSums()/colSums() to preserve the
storage mode?

m <- matrix(1:15, nrow=5)

 > storage.mode(m)
[1] "integer"

 > storage.mode(sum(m))
[1] "integer"

 > storage.mode(rowSums(m))
[1] "double" <------------------- surprising!

Cheers,
H.



[Rd] rowSums()/colSums() don't preserve the 'integer' storage mode
Herve Pages