plus
Returns the sum of all values provided as arguments but ensures NA
+
NA
= NA
.
plus(x, na.rm = F)
x | numeric vector. |
---|---|
na.rm | logical. Should missing values be removed? |
The sum of x
This function is the same as sum
() but if na.rm
is FALSE
and all input
values are NA
, it will return NA
instead of 0.
plus(1:10)#> [1] 55#> [1] NA#> [1] NA