powered by
Compute Shannon Index
ds_shannon(.data, .cols, .name)shannon(..., .data = dplyr::across(everything()))
shannon(..., .data = dplyr::across(everything()))
a tibble or numeric vector if .name missing
tibble
tidy-select Columns to compute the measure with.
tidy-select
name for column with Shannon index. Leave missing to return a vector.
arguments to forward to ds_shannon from shannon
data('de_county') ds_shannon(de_county, starts_with('pop_')) ds_shannon(de_county, starts_with('pop_'), 'shannon')
Run the code above in your browser using DataLab