Calculate the coefficient of variation (i.e. variation coefficient) for a vector.
cv(x, na.rm = FALSE)
x | a numeric vector |
---|---|
na.rm | Passed directly to |
a scalar equal to \(\frac{s_{x}}{\overline{x}}\).
Weisstein, Eric W. "Variation Coefficient." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/VariationCoefficient.html
x <- 1:5 y <- c(x^2, NA) cv(x) > cv(y, na.rm = TRUE)#> [1] FALSE