mat.to.edgl {ANTs}R 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.

Value

a data frame representing an edge list.

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)

[Package ANTs version 0.0.16 Index]