as_mixing_matrix: Construct a graph object's mixing matrix.

Description Usage Arguments Details Value Author(s) Examples

View source: R/mixing-matrix.R

Description

Using a categorical vertex attribute, construct a matrix depicting network mixing patterns.

Usage

1
2
as_mixing_matrix(g, dim1, dim2 = NULL, direction = c("all", "out",
  "in"))

Arguments

g

<igraph>, <network>

dim1

Either the name of a node/vertex attribute or vector of same length as the number of nodes in g.

dim2

If not provided, the same as dim1. Otherwise, a vector of the same length as the number of nodes in g.

direction

<chr> The direction of ties to take into a account.

  • "all", "out", or "in"

Details

Value

Author(s)

Brendan Knapp brendan.g.knapp@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
as_mixing_matrix(jemmah_islamiyah, dim1 = "role")
as_mixing_matrix(jemmah_islamiyah, dim1 = "name", dim2 = "role")

data("sampson", package = "ergm")
as_mixing_matrix(samplike, dim1 = "vertex.names", dim2 = "group",
                 direction = "all")
as_mixing_matrix(samplike, dim1 = "vertex.names", dim2 = "group",
                 direction = "out")
as_mixing_matrix(samplike, dim1 = "vertex.names", dim2 = "group", 
                 direction = "in")

knapply/homophily documentation built on Nov. 4, 2019, 3:54 p.m.