Learn R Programming

sna (version 2.8)

upper.tri.remove: Remove the Upper Triangles of Adjacency Matrices in a Graph Stack

Description

Returns the input graph stack, with the upper triangle entries removed/replaced as indicated.

Usage

upper.tri.remove(dat, remove.val=NA)

Value

The updated graph stack.

Arguments

dat

a graph or graph stack.

remove.val

the value with which to replace the existing upper triangles.

Author

Carter T. Butts buttsc@uci.edu

Details

upper.tri.remove is simply a convenient way to apply g[upper.tri(g)]<-remove.val to an entire stack of adjacency matrices at once.

See Also

upper.tri, lower.tri.remove, diag.remove

Examples

Run this code
#Generate a random graph stack
g<-rgraph(3,5)
#Remove the upper triangles
g<-upper.tri.remove(g)

Run the code above in your browser using DataLab