Learn R Programming

migraph (version 0.8.13)

diversity: Measures of network diversity

Description

These functions offer ways to summarise the heterogeneity of an attribute across a network, within groups of a network, or the distribution of ties across this attribute.

Usage

graph_blau_index(object, attribute, clusters = NULL)

graph_ei_index(object, attribute)

Arguments

object

A data frame edgelist, matrix, igraph, tidygraph, or network object.

attribute

The name of a vertex attribute to measure the diversity of.

clusters

A nodal cluster membership vector or name of a vertex attribute.

Examples

Run this code
# NOT RUN {
marvel_friends <- to_unsigned(ison_marvel_relationships, "positive")
graph_blau_index(marvel_friends, "Gender")
graph_blau_index(marvel_friends, "Attractive")
graph_blau_index(marvel_friends, "Gender", "Rich")
graph_ei_index(marvel_friends, "Gender")
graph_ei_index(marvel_friends, "Attractive")
# }

Run the code above in your browser using DataLab