plus: Vectorized addition with na.rm

Description Usage Arguments Examples

Description

plus adds together multiple vectors in element-wise fashion, so plus(a, b, c) would be similar to a + b +c. Unlike +, plus takes an na.rm argument to handle NA behavior.

Usage

1
plus(..., na.rm = TRUE)

Arguments

...

a set of vectors. Each vector should be numeric, integer, or coercible to numeric. na.rm logical. Should missing values (including NaN) be omitted from the calculations?

Examples

1
2
3
4
5
a <- c(NA, 2, 3)
b <- c(1, NA, 3)
c <- c(1, 2, NA)
plus(a, b, c)
plus(a, b, c, na.rm = FALSE)

rstudio/EDAWR documentation built on May 28, 2019, 4:33 a.m.