ds_gini: Compute Gini Index

Description Usage Arguments Value Examples

View source: R/gini.R

Description

Compute Gini Index

Usage

1
2
3
ds_gini(.data, .cols, .name, .comp = FALSE)

gini(..., .data = dplyr::cur_data_all())

Arguments

.data

tibble

.cols

tidy-select Columns to compute the measure with. Must be at least 2 columns. If more than 2, treats first column as first group and sum of other columns as second.

.name

name for column with gini index. Leave missing to return a vector.

.comp

Default is FALSE. FALSE returns the sum, TRUE returns the components.

...

arguments to forward to ds_gini from gini

Value

a tibble or numeric vector if .name missing

Examples

1
2
3
data("de_county")
ds_gini(de_county, c(pop_white, starts_with('pop_')))
ds_gini(de_county, starts_with('pop_'), 'gini')

divseg documentation built on Aug. 9, 2021, 9:09 a.m.