These functions offer ways to measure the heterogeneity of an attribute across a network, within groups of a network, or the distribution of ties across this attribute:
node_by_richness() measures the number of unique categories
of an attribute to which each node is connected.
node_by_diversity() measures the heterogeneity of each node's
local neighbourhood.
node_by_richness(.data, attribute)
node_by_diversity(
.data,
attribute,
diversity = c("blau", "teachman", "variation", "gini")
)A network object of class stocnet, igraph, tbl_graph, network, or similar.
Internally any of these will be coerced to an efficient implementation.
For more information on possible coercions, see e.g. manynet::as_stocnet().
Name of a nodal attribute, mark, measure, or membership vector.
Which method to use for *_diversity().
Either "blau" (Blau's index) or "teachman" (Teachman's index) for categorical attributes,
or "variation" (coefficient of variation) or "gini" (Gini coefficient) for numeric attributes.
Default is "blau".
If an incompatible method is chosen for the attribute type,
a suitable alternative will be used instead with a message.
A node_measure numeric vector the length of the nodes in the network,
providing the scores for each node.
If the network is labelled,
then the scores will be labelled with the nodes' names.
The object also carries the measure it computed, the range its values
can fall within, and whether and how those values were normalized.
These are shown as a one-line header when the object is printed.
Where a measure offers a choice between several ways of counting the
same thing, it also carries the variant it used.
All can be retrieved with attr().
Other diversity:
measure_assort_net,
measure_assort_node,
measure_diverse_net,
motif_composition,
motif_homophily
Other measures:
measure_assort_net,
measure_assort_node,
measure_breadth,
measure_broker_node,
measure_broker_tie,
measure_brokerage,
measure_central_between,
measure_central_close,
measure_central_degree,
measure_central_eigen,
measure_central_tie_between,
measure_central_tie_close,
measure_central_tie_degree,
measure_central_tie_eigen,
measure_closure,
measure_closure_node,
measure_cohesion,
measure_core,
measure_diffusion_infection,
measure_diffusion_net,
measure_diffusion_node,
measure_diverse_net,
measure_features,
measure_fit,
measure_fragmentation,
measure_hierarchy,
measure_periods
Other nodal:
mark_core,
mark_degree,
mark_diff,
mark_nodes,
mark_select_node,
measure_assort_node,
measure_broker_node,
measure_brokerage,
measure_central_between,
measure_central_close,
measure_central_degree,
measure_central_eigen,
measure_closure_node,
measure_core,
measure_diffusion_node,
member_brokerage,
member_cliques,
member_community,
member_community_hier,
member_community_non,
member_components,
member_core,
member_diffusion,
member_equivalence,
motif_brokerage_node,
motif_clique,
motif_composition,
motif_exposure,
motif_node,
motif_path
node_by_richness(ison_networkers, "Discipline")
#> # Richness [0, Inf)
#> ▂▃▁▅
#> `Lin Freeman` `Doug White` `Ev Rogers` `Richard Alba` `Phipps Arabie`
#> 1 4 4 2 4 4
#> # ... and 27 more values from this nodeset. Use `print_all(...)` to print all values.
marvel_friends <- to_unsigned(to_uniplex(fict_marvel, "relationship"), "positive")
node_by_diversity(marvel_friends, "Gender")
#> # Blau's index, normalized [0, 1]
#> ▃▁▁▃▂
#> Abomination `Ant-Man` Apocalypse Beast `Black Panther` `Black Widow` Blade
#> 1 0 0.48 0 0.363 0.34 0.337 0
#> # ... and 46 more values from this nodeset. Use `print_all(...)` to print all values.
node_by_diversity(marvel_friends, "Attractive")
#> # Coefficient of variation (-Inf, Inf)
#> ▂▄▂▂▁▁▁▁▁
#> Abomination `Ant-Man` Apocalypse Beast `Black Panther` `Black Widow` Blade
#> 1 NA 0.559 NaN 0.332 0.316 0.288 0
#> # ... and 46 more values from this nodeset. Use `print_all(...)` to print all values.