sum_na: Return the sum

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Return the sum of 'x'. If no observations, return 'NA'. This is a workaround for the fact that in data.table, ':= sum()' will return 'NaN' where there are no observations

Usage

1
sum_na(x)

Arguments

x

data potentially with non-finite values

Value

Sum of the input

Examples

1
sum_na(c(1,2,3,NA)) # 6

dateutils documentation built on Nov. 10, 2021, 5:09 p.m.