Learn R Programming

migraph (version 0.10.6)

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)

graph_assortativity(object)

Arguments

object

An object of a migraph-consistent class:

  • matrix (adjacency or incidence) from {base} R

  • edgelist, a data frame from {base} R or tibble from {tibble}

  • igraph, from the {igraph} package

  • network, from the {network} package

  • tbl_graph, from the {tidygraph} package

attribute

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

clusters

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

Functions

  • graph_blau_index: Calculates the heterogeneity of ties across a network or within clusters by node attributes

  • graph_ei_index: Calculates the embeddedness of a node within the group of nodes of the same attribute

  • graph_assortativity: Calculates the degree assortativity in a graph

See Also

Other measures: centralisation, centrality, closure, cohesion(), features, holes

Examples

Run this code
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")
graph_assortativity(mpn_elite_mex)

Run the code above in your browser using DataLab