Drop-in replacements for rowMeans() and rowSums() that default to
na.rm = TRUE. Both return NA for rows where ALL values are missing
(base rowMeans() returns NaN, base rowSums() returns 0).
Usage
rowMeans(x, na.rm = TRUE, all_na = NULL, dims = 1L, ...)
rowSums(x, na.rm = TRUE, all_na = NULL, dims = 1L, ...)Arguments
- x
A numeric matrix or data frame.
- na.rm
Logical. Should missing values be removed? Default
TRUE.- all_na
Character. What to do when all values are NA:
"error"(default) throws an error,"base"returns what base R does withna.rm = TRUE(NaNforrowMeans(),0forrowSums()),"na"returnsNA. IfNULL, usesgetOption("tidyna.all_na", "error").- dims
Integer. Number of dimensions to treat as rows.
- ...
Additional arguments passed to the base function.