sd_na {dateutils}R Documentation

Return the standard deviation

Description

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

Usage

sd_na(x)

Arguments

x

data potentially with non-finite values

Value

Standard deviation of the input

Examples

sd_na(c(1,2,3,NA)) ## 1

[Package dateutils version 0.1.5 Index]