Calculates central or non-central sample moments.
moment(z, p = 1, central = TRUE, na.rm = TRUE)
Numeric vector of length 1.
moment(1:10, p = 1)
#> [1] 0
moment(1:10, p = 1, central = FALSE)
#> [1] 5.5
moment(1:10, p = 2) / stats::var(1:10)
#> [1] 0.9