Skip to contents

Computes the coefficient of variation of input vector.

Usage

cv(x, na.rm = FALSE)

Arguments

x

Input vector to compute CV for.

na.rm

boolean to remove NA. default is FALSE

Value

CV of x. Standard deviation divided by mean. If you want % you'll need to multiply by 100

Examples

cv(c(1, 2, 1, 1, 2, 1, 2, 3))
#> [1] 0.4578608