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.

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.

Examples

data("egor32") alts_diversity_count(egor32, "age")
#> # A tibble: 32 x 2 #> .egoID result #> <chr> <dbl> #> 1 1 3 #> 2 2 7 #> 3 3 6 #> 4 4 7 #> 5 5 3 #> 6 6 6 #> 7 7 3 #> 8 8 7 #> 9 9 3 #> 10 10 3 #> # … with 22 more rows
alts_diversity_entropy(egor32, "age")
#> # A tibble: 32 x 2 #> .egoID result #> <chr> <dbl> #> 1 1 1.41 #> 2 2 2.29 #> 3 3 2.05 #> 4 4 2.25 #> 5 5 1.36 #> 6 6 2.05 #> 7 7 1.32 #> 8 8 2.25 #> 9 9 1.39 #> 10 10 1.32 #> # … with 22 more rows