Learn R Programming

sna (version 0.41)

symmetrize: Symmetrize an Adjacency Matrix

Description

Symmetrizes the elements of mats according to the rule in rule.

Usage

symmetrize(mats, rule="weak")

Arguments

mats
A graph or graph stack
rule
One of ``upper'', ``lower'', ``strong'' or ``weak''

Value

  • The symmetrized graph stack

Details

The rules used by symmetrize are as follows:
  1. upper: Copy the upper triangle over the lower triangle
  2. lower: Copy the lower triangle over the upper triangle
  3. strong: i<->j iff i->j and i<-j (AND rule)
  4. weak: i<->j iff i->j or i<-j (OR rule)

References

Wasserman, S., and Faust, K. (1994). Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.

Examples

Run this code
#Generate a graph
g<-rgraph(5)

#Weak symmetrization
symmetrize(g)

#Strong symmetrization
symmetrize(g,rule="strong")

Run the code above in your browser using DataLab