Skip to contents

The Gini coefficient of a vector of numbers: 0 when all are equal, close to 1 when one holds almost everything.

Usage

vp_gini(x)

Arguments

x

A numeric vector.

Value

A number between 0 and 1.

See also

Examples

vp_gini(c(1, 1, 1, 1))
#> [1] 0
vp_gini(c(0, 0, 0, 10))
#> [1] 0.75