vector_sum_na_rm: A re-coding of the sum function which returns NA if all...

View source: R/vector_sum_na_rm.R

vector_sum_na_rmR Documentation

A re-coding of the sum function which returns NA if all values are NA

Description

A re-coding of the sum function which returns NA if all values are NA. This function sums vectors together.

Usage

vector_sum_na_rm(...)

Arguments

...

numeric vectors of equal length

Value

numeric vector of length equal to provided vectors

Examples

tibble(x = c(NA, NA, NA), y = c(NA, 2, NA), z = c(1, NA, NA)) %>%
   mutate(new = vector_sum_na_rm(x, y, z))

uclalawcovid19behindbars/behindbarstools documentation built on April 22, 2022, 4:08 a.m.