#Draw a random mixing matrix
mix<-matrix(runif(9),3,3)
#Generate a graph with 4 members per class
g<-rgnmix(1,rep(1:3,each=4),mix)
plot.sociomatrix(g) #Visualize the result
#Repeat the exercise, using the exact method
mix2<-round(mix*8) #Draw an exact matrix
g<-rgnmix(1,rep(1:3,each=4),mix2,method="exact")
plot.sociomatrix(g)
Run the code above in your browser using DataLab