mix_matrix | R Documentation |
Create a mixing matrix from node attributes. The mixing matrix is a two-dimensional matrix that cross-classifies the edges depending on the values of their attributes. This matrix allowed identifying segregation and homophily at the network level.
mix_matrix(A, att = NULL)
A |
A symmetric matrix object |
att |
Categorical attribute of the nodes |
Values in the diagonal are the number of ties within groups, and off-diagonal are the number of relations between groups.
This function returns a mixing matrix.
Alejandro Espinosa-Rada
n <- 100
A <- matrix(c(rbinom(n, 1, 0.5)),
ncol = sqrt(n), nrow = sqrt(n), byrow = TRUE
)
rownames(A) <- letters[1:nrow(A)]
colnames(A) <- letters[1:ncol(A)]
att <- rbinom(sqrt(n), 3, 0.5)
mix_matrix(A, att = att)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.