Vectorized sum, similiar to pmin and pmax

psum(..., na.rm = FALSE)

Arguments

...

numeric vectors to sum

na.rm

a logical indicating whether missing values should be removed

Value

a vector with sum of ... arguments

Examples

psum(c(1, 2, 3), c(4, 5, 6))
#> [1] 5 7 9
psum(c(1, 2, 3), pi)
#> [1] 4.141593 5.141593 6.141593
psum(c(1, NA, 3), c(4, 5, 6), na.rm = TRUE)
#> [1] 5 5 9