View source: R/mixing_matrix_igraph_function.R
mixing_matrix_igraph | R Documentation |
This function calculates the mixing matrix for an igraph object
mixing_matrix_igraph(gs, attrname)
gs |
igraph object. |
attrname |
Attribute name (vertex attribute) |
Mixing matrix
require(igraph)
##Create random International Trade Network (igraph object)
gs<-erdos.renyi.game(50,0.05,directed = TRUE)
##Add vertex attributes
V(gs)$LETTER<-rep(LETTERS[1:5],10)
##Add vertex names
V(gs)$name<-1:vcount(gs)
##Calculate mixing matrix
mixing_matrix<-mixing_matrix_igraph(gs,"LETTER")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.