Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ergm)
- test.net = as.network(matrix(0,10,10), directed = F) #10-node network
- test.net%v%"class" = sample(c('1','2'), 10, replace = T) #nodal attribute
- test.sim = simulate(test.net ~ edges + nodematch("class"), coef = c(-1, 4))
- plot(test.sim, vertex.col = as.numeric(test.net%v%"class"), vertex.cex = 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement