dot-cv: Coefficient of variation (expressed as percentage)

.cvR Documentation

Coefficient of variation (expressed as percentage)

Description

R function to compute the coefficient of variation (expressed as a percentage). If there is only a single value, stats::sd = NA. However, one could argue that cv =0; and NA may break the code that receives it. The function returns 0 if the mean is close to zero.

Usage

.cv(x)

Arguments

x

a vector of values

Details

This is ODD: abs to avoid very small (or zero) mean with e.g. -5:5

Value

the cv


EvolEcolGroup/pastclim documentation built on Nov. 8, 2024, 5:21 a.m.