Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gini

Gini dispersion index


Description

Gini index for each column of a matrix.

Usage

gini(x)

Arguments

x

a non-negative numeric matrix, or an object that can be coerced to such a matrix by as.matrix.

Details

The Gini coefficient or index is a measure of inequality or diversity. It is zero if all the values of x are equal. It reaches a maximum value of 1/nrow(x) when all values are zero except for one.

The Gini index is only interpretable for non-negative quantities. It is not meaningful if x contains negative values.

Value

Numeric vector of length ncol(x).

Author(s)

Gordon Smyth

References

Examples

x <- matrix(rpois(20,lambda=5),10,2)
gini(x)

edgeR

Empirical Analysis of Digital Gene Expression Data in R

v3.32.1
GPL (>=2)
Authors
Yunshun Chen, Aaron TL Lun, Davis J McCarthy, Matthew E Ritchie, Belinda Phipson, Yifang Hu, Xiaobei Zhou, Mark D Robinson, Gordon K Smyth
Initial release
2021-01-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.