sum_na {dateutils}R Documentation

Return the sum

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

sum_na(x)

Arguments

x

data potentially with non-finite values

Value

Sum of the input

Examples

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

[Package dateutils version 0.1.5 Index]