gm_CV: Calculate the geometric coefficient of variation (CV)

View source: R/gm_mean.R

gm_CVR Documentation

Calculate the geometric coefficient of variation (CV)

Description

gm_CV takes as input a numeric vector and returns the geometric CV, calculated as: sqrt(exp(sd(log(x))^2)-1)

Usage

gm_CV(x, na.rm = TRUE, zero.propagate = FALSE)

Arguments

x

A vector of numbers

na.rm

Should NA values be removed? (logical)

zero.propagate

Should zeroes be propagated? (logical)

Examples


gm_CV(rnorm(10, 5, 1))
gm_CV(c(5, 3, 6, 10, 2, 0), zero.propagate = TRUE)


shirewoman2/Consultancy documentation built on Feb. 18, 2025, 10 p.m.