alts_diversity_count: Calculate diversity measures on an 'egor' object.

View source: R/composition.R

alts_diversity_countR Documentation

Calculate diversity measures on an egor object.

Description

alts_diversity_count() counts the categories of a variable present in the networks of an egor object. alts_diversity_entropy() calculates the Shannon entropy as a measurement for diversity of an alter attribute.

Usage

alts_diversity_count(object, alt.attr)

alts_diversity_entropy(object, alt.attr, base = 2)

Arguments

object

An egor object.

alt.attr

A character naming the variable containing the alter-attribute.

base

Numeric, base value of logarithm for entropy calculation.

Value

A tibble with the ego ID and a numeric result vector.

Author(s)

MichaƂ Bojanowski, michal2992@gmail.com

Till Krenz, egor@tillt.net

Examples

data("egor32")
alts_diversity_count(egor32, "age")
alts_diversity_entropy(egor32, "age")

egor documentation built on May 29, 2024, 12:10 p.m.