Adaptation of base::colSums()
that, when all values in a column are NA, sets the sum to NA rather than zero as base::colSums()
does. Calls base::colSums()
internally.
Arguments
- mx
numeric matrix
- na.rm
logical(1). TRUE if missing values (
NA
) should be ignored in the summation. If FALSE (default), even one missing value will result inNA
for the entire column.- dims
See documentation for
base::colSums()