gini_index_fun: Compute the Gini index of a numeric vector
Description
Computes the Gini index (a measure of inequality) for a numeric vector.
Non-finite (NA, NaN, Inf) values are removed prior to computation.
If fewer than two finite values remain, the function returns 0.
Usage
gini_index_fun(x)
Value
A numeric scalar giving the Gini index of x.
Arguments
x
Numeric vector.
Details
The Gini index ranges from 0 (perfect equality) to 1 (maximal inequality).