powered by
Perform row sum
helper_rowSums(x, allNA0 = TRUE, ...)
A numeric or complex array of suitable size, or a vector if the result is one-dimensional.
an array of two or more dimensions, containing numeric, complex, integer or logical values, or a numeric data frame
logical indicating that if a whole row is NA to give the row sum as NA. Only works for two dimensional x and if na.rm is TRUE.
x
na.rm
TRUE
other arguments to pass to base::rowSums()
base::rowSums()
Essentially equivalent to base::rowSums() except with the addition of the allNA0 argument.
allNA0
x <- data.frame(v1 = c(NA,1:4), v2 = c(NA, 2:5), v3 = c(NA, 1:2, NA, 3)) helper_rowSums(x, na.rm = TRUE, allNA0 = TRUE) helper_rowSums(x, na.rm = TRUE, allNA0 = FALSE)
Run the code above in your browser using DataLab