Description Usage Arguments Details Value Examples
Will sum values returning NA only if all values are NA, otherise will ignore
1 |
... |
numbers or vectors to be summed. Must be type logical or numeric. |
this function will provide vectorized sums with NAs ignored unless only NAs are present
a numeric vector of the same length as the arguments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # ignores NA
sum_ignore_NA(2, 3, NA)
# returns NA if all values are NA
sum_ignore_NA(NA, NA, NA)
# returns vectorized sums
x <- c(1, 2, NA)
y <- c(1:3)
sum_xy <- sum_ignore_NA(x, y)
data.frame(x, y, sum_xy)
x <- c(1, 2, NA)
y <- c(1, 2, NA)
sum_xy <- sum_ignore_NA(x, y)
data.frame(x, y, sum_xy)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.