Advertisement
Guest User

Untitled

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