Learn R Programming

sna (version 0.41)

diag.remove: Remove the Diagonals of Adjacency Matrices in a Graph Stack

Description

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

Usage

diag.remove(dat, remove.val=NA)

Arguments

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

Value

  • The updated graph stack

Details

diag.remove is simply a convenient way to apply diag to an entire stack of adjacency matrices at once.

See Also

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

Examples

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

Run the code above in your browser using DataLab