[Rd] drop argument for apply, rowSums, etc.

Claudia Beleites cbeleites at units.it
Mon Feb 14 22:03:24 CET 2011

Dear list, dear Henrik,

I find myself often reconstructing matrices from the result of rowSum (matrix) 
etc. I therefore propose a new argument, drop, for these functions:

drop = TRUE (default) is the current behaviour. With
drop = FALSE length (dim (x)) and dimnames are preserved and the affected 
dimensions are set to 1 (or whatever teh result length of the applied function is)

I modified the base functions in colSums.R accordingly, and provide the 
respective methods (I did not yet have the time to look into apply.R).

I'm wondering whether these changes are of sufficient interest to the R public 
that these methods should have a more obvious "home" than a spectroscopy 
package. As I learned this morning of package matrixStats: Henrik, would you 
like to include these modified functions?

Anyways, the code is in the attached file, so if someone needs the funcionality, 
he can find it here.


Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbeleites at units.it
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: colSums.R
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20110214/d4641f70/attachment.pl>

More information about the R-devel mailing list