mixing_matrix_igraph: Mixing Matrix

Description Usage Arguments Value Examples

View source: R/mixing_matrix_igraph_function.R

Description

This function calculates the mixing matrix for an igraph object

Usage

1
mixing_matrix_igraph(gs, attrname)

Arguments

gs

igraph object.

attrname

Attribute name (vertex attribute)

Value

Mixing matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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")

ITNr documentation built on March 13, 2020, 1:48 a.m.