# NOT RUN {
#generating a simple network corresponding to the simple Sum of squares
#structural equivalence with blockmodel:
# null com
# null null
n<-c(7,13)
net<-matrix(NA,nrow=n[1],ncol=n[2])
clu<-list(rep(1:2,times=c(3,4)),rep(1:2,times=c(5,8)))
tclu<-lapply(clu,table)
net[clu[[1]]==1,clu[[2]]==1]<-rnorm(n=tclu[[1]][1]*tclu[[2]][1],
mean=0,sd=1)
net[clu[[1]]==1,clu[[2]]==2]<-rnorm(n=tclu[[1]][1]*tclu[[2]][2],
mean=4,sd=1)
net[clu[[1]]==2,clu[[2]]==1]<-rnorm(n=tclu[[1]][2]*tclu[[2]][1],
mean=4,sd=1)
net[clu[[1]]==2,clu[[2]]==2]<-rnorm(n=tclu[[1]][2]*tclu[[2]][2],
mean=0,sd=1)
plot.mat(net,clu=clu) #two mode matrix of a two mode network
#converting to one mode network
M1<-two2one(net)$M
plot.mat(M1,clu=two2one(net)$clu) #plotting one mode matrix
plot.mat(one2two(M1,clu=clu)$M,clu=clu)
#converting one to two mode matix and ploting
# }
Run the code above in your browser using DataLab