I have a dataset as follows:
set.seed(123)
A = data.frame(rnorm(10),rnorm(10),rnorm(10),rnorm(10))
And then use the igraph package to make a network of the following:
inv<-cor(t(A))
inv[inv<0.5] <- 0
inv[inv==1] <- 0
g1 <- graph.adjacency(inv, mode = "undirected", diag=FALSE, weighted=TRUE)
Now, to calculate the sort factor g1,
assortativity (g1, types1, types2 = NULL, directed = TRUE)
Now my question is: how do I set the βtypesβ, it says in the documentation, these are the values ββof the vertices. What exactly is meant by this? I would like to calculate assortivity for any 5 vertex network. Can someone tell me how to do this?
source
share