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)
object | An |
---|---|
alt.attr | A |
base |
|
A tibble
with the ego ID and a numeric
result vector.
Michał Bojanowski, m.bojanowski@uw.edu.pl
Till Krenz, public@tillt.net
#> # A tibble: 32 x 2 #> .egoID diversity #> <fct> <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 rowsalts_diversity_entropy(egor32, "age")#> # A tibble: 32 x 2 #> .egoID entropy #> <fct> <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