Learn R Programming

BioQC (version 1.0.0)

gini: Calculate Gini Index of a numeric vector

Description

Calculate the Gini index of a numeric veector

Usage

gini(x, na.rm=FALSE)

Arguments

x
A numeric vector.
na.rm
Logical. If set to TRUE, NA values are omitted.

Value

A numeric value between 0 and 1.

Details

The Gini index (Gini coefficient) is a measure of statistical dispersion. A Gini coefficient of zero expresses perfect equality where all values are the same. A Gini coefficient of one expresses maximal inequality among values.

References

Gini. C. (1912) Variability and Mutability, C. Cuppini, Bologna 156 pages.

Examples

Run this code
testValues <- runif(100)
gini(testValues)

Run the code above in your browser using DataLab