assort(WhiteKinship, "gender")
assort(EF3, "type")
# Values of `assort()` for full networks of different sizes
if( requireNamespace("igraph", quietly = TRUE) ) {
f <- function(n) {
gfull <- igraph::make_full_graph(n, directed=FALSE)
igraph::V(gfull)$type <- rep(1:2, length = igraph::vcount(gfull))
assort(gfull, "type")
}
set.seed(1)
x <- sort(sample(5:100, 25) * 2)
y <- sapply(x, f)
plot(x, y, type="o",
xlab="Network size", ylab="Assortativity coefficient",
main="Assortativity coef. for full networks of different sizes")
}
Run the code above in your browser using DataLab