Compute the coefficient of variation

ds_cvar(x, data = NULL, na.rm = FALSE)

Arguments

x

a numeric vector

data

a data.frame or tibble

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Examples

ds_cvar(mtcars$mpg)
#> [1] 29.99881
ds_cvar(mpg, mtcars)
#> [1] 29.99881