Learn R Programming

migraph (version 0.9.3)

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, 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_assortativity: Calculates the degree assortativity in a graph

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")
graph_assortativity(mpn_elite_mex)
# }

Run the code above in your browser using DataLab