Learn R Programming

sna (version 0.3)

lower.tri.remove: Remove the Lower Triangles of Adjacency Matrices in a Graph Stack

Description

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

Usage

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

Arguments

dat
A graph stack
remove.val
The value with which to replace the existing lower triangles

Value

  • The updated graph stack

Details

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

See Also

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

Examples

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

Run the code above in your browser using DataLab