Skip to contents

Calculates the variance after excluding missing values. A fast, unsafe alternative to stats::var(x, na.rm = TRUE).

Usage

fvar(x)

Arguments

x

(numeric)
The numeric vector to calculate the variance.

Value

Scalar numeric

See also

Examples

#----------------------------------------------------------------------------
# fvar() example
#----------------------------------------------------------------------------
library(bkbase)

fvar(1:3)
#> [1] 1
fvar(c(1:3, NA))
#> [1] 1