Learn R Programming

RcmdrMisc (version 2.10.2)

cv: Coefficient of variation

Description

Coefficient of variation

Usage

cv(x, na.rm = TRUE, ...)

CV(x, na.rm = TRUE)

Value

cv returns the coefficient(s) of variation.

Arguments

x

data a numeric vector, matrix, or data frame.

na.rm

if TRUE (the default) remove NAs before computing the coefficient of variation.

...

ignored

Author

John Fox

Details

numSummary creates neatly formatted tables of means, standard deviations, coefficients of variation, skewness, kurtosis, and quantiles of numeric variables. CV computes the coefficient of variation.

Examples

Run this code
data(Prestige)
print(cv(Prestige[,c("income", "education")]))

Run the code above in your browser using DataLab