mat_to_net: Create a data.frame from a contingency table
Description
This function generates a two- or three-column data.frame, where
each row represents the interaction between two nodes (e.g., site and species)
and an optional third column indicates the weight of the interaction
(if weight = TRUE). The input is a contingency table, with rows
representing one set of entities (e.g., site) and columns representing
another set (e.g., species).
A data.frame where each row represents the interaction
between two nodes. If weight = TRUE, the data.frame includes a third
column representing the weight of each interaction.
Arguments
mat
A contingency table (i.e., a matrix).
weight
A logical value indicating whether the values in the matrix
should be interpreted as interaction weights.
remove_zeroes
A logical value determining whether interactions with
a weight equal to 0 should be excluded from the output.
include_diag
A logical value indicating whether the diagonal
(self-interactions) should be included in the output. This applies only to
square matrices.
include_lower
A logical value indicating whether the lower
triangular part of the matrix should be included in the output. This
applies only to square matrices.