ds_shannon: Compute Shannon Index

View source: R/shannon.R

ds_shannonR Documentation

Compute Shannon Index

Description

Compute Shannon Index

Usage

ds_shannon(.data, .cols, .name)

shannon(..., .data = dplyr::across(everything()))

Arguments

.data

tibble

.cols

tidy-select Columns to compute the measure with.

.name

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

...

arguments to forward to ds_shannon from shannon

Value

a tibble or numeric vector if .name missing

Examples

data("de_county")
ds_shannon(de_county, starts_with('pop_'))
ds_shannon(de_county, starts_with('pop_'), 'shannon')

divseg documentation built on Dec. 28, 2022, 1:53 a.m.