Calculates the variance after excluding missing values.
A fast, unsafe alternative to stats::var(x, na.rm = TRUE).
Arguments
- x
(numeric)
The numeric vector to calculate the variance.
Examples
#----------------------------------------------------------------------------
# fvar() example
#----------------------------------------------------------------------------
library(bkbase)
fvar(1:3)
#> [1] 1
fvar(c(1:3, NA))
#> [1] 1