el2sm: Edgelist to sociomatrix

Description Usage Arguments Value Author(s) Examples

View source: R/rda.R

Description

Construction of a sociomatrix from an edgelist

Usage

1
el2sm(el,directed=TRUE,nadiag=all(el[,1]!=el[,2]))

Arguments

el

a matrix in which each row contains the indices of an edge and possibly the weight for the edge

directed

if FALSE, then a relation is placed in both entry ij and ji of the sociomatrix, for each edge ij (or ji)

nadiag

put NAs on the diagonal

Value

a sociomatrix

Author(s)

Peter Hoff

Examples

1
2
3
Y<-matrix(rpois(10*10,.5),10,10) ; diag(Y)<-NA
E<-sm2el(Y)
el2sm(E) - Y

MikeKozelMSU/mcmcFunc documentation built on May 22, 2019, 5:31 p.m.