powered by
Construction of a sociomatrix from an edgelist
el2sm(el,directed=TRUE,nadiag=all(el[,1]!=el[,2]))
a sociomatrix
a matrix in which each row contains the indices of an edge and possibly the weight for the edge
if FALSE, then a relation is placed in both entry ij and ji of the sociomatrix, for each edge ij (or ji)
put NAs on the diagonal
Peter Hoff
Y<-matrix(rpois(10*10,.5),10,10) ; diag(Y)<-NA E<-sm2el(Y) el2sm(E) - Y
Run the code above in your browser using DataLab