R/ginis.R

Defines functions ginis

Documented in ginis

#[export]
ginis <- function(x) {
  n <- dim(x)[1]
  x <- Rfast::colSort(x)
  g <- Rfast::eachcol.apply(x, 1:n)
  2 * g / n / Rfast::colsums(x) - (n + 1)/n
}

Try the Rfast package in your browser

Any scripts or data that you put into this service are public.

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.