mat.to.edgl: Matrix to edge list

View source: R/mat.to.edgl.R

mat.to.edglR Documentation

Matrix to edge list

Description

Converts a square adjacency matrix into a data frame of three columns representing an edge list. Columns are: actor, receiver and weight.

Usage

mat.to.edgl(M, sym = FALSE, erase.diag = TRUE)

Arguments

M

a square adjacency matrix.

sym

if TRUE, it extracts the lower triangle of the matrix only.

erase.diag

if TRUE, it omits diagonals.

Author(s)

Sebastian Sosa, Ivan Puga-Gonzalez.

References

Sosa, S. (2018). Social Network Analysis, in: Encyclopedia of Animal Cognition and Behavior. Springer.

Examples

mat.to.edgl(sim.m, sym = FALSE, erase.diag = TRUE)

SebastianSosa/ant documentation built on Sept. 23, 2023, 7:06 a.m.