summarize_network: Summarize one ecological network

View source: R/metrics.R

summarize_networkR Documentation

Summarize one ecological network

Description

Summarize one ecological network

Usage

summarize_network(network, threshold = NULL)

Arguments

network

Ecological network or numeric matrix.

threshold

Optional finite threshold for realized links; for probability networks it must lie in ⁠[0, 1]⁠.

Value

A one-row data frame with row_richness, column_richness, possible_links (number of eligible matrix entries), expected_links (sum of eligible entries, or number at least threshold), and mean_probability (mean of eligible nonmissing entries). For networks with self_links = FALSE, pairs with the same species name are excluded. Unnamed same-group square networks use the diagonal; unnamed networks across different groups require species names. Other inputs use all matrix entries, including missing entries in the possible-link count. Missing values are omitted from sums and means. Without eligible entries the mean is NA; if all are missing it is NaN. For weighted/observed networks these fields summarize weights, not link probabilities; use threshold to count entries at or above a cutoff.

Examples

p <- matrix(c(0.8, 0.3), 2)
summarize_network(p)
summarize_network(p, threshold = 0.5)

metaweave documentation built on Nov. 3, 2026, 9:06 a.m.