Skip to contents

This function computes the percent coefficient of variation of the values in x. If na.rm is TRUE then missing values are removed before computation proceeds.

Usage

cv(x, na.rm = FALSE)

Arguments

x

a numeric vector with untransformed data

na.rm

logical, if TRUE then NA values are stripped from x before computation takes place

Value

a numeric value. If x contains a zero or is not numeric, NA_real_ is returned

Examples

cv(c(5, 6, 3, 4, 5, NA), na.rm = TRUE)
#> [1] 24.7864222848