compare_networks: Compare two weighted networks

View source: R/network_analysis.R

compare_networksR Documentation

Compare two weighted networks

Description

Compare two weighted networks

Usage

compare_networks(x, y, threshold = 0)

Arguments

x, y

Supported network representations.

threshold

Absolute weight threshold for edge presence: a dyad counts as an edge when abs(weight) > threshold.

Details

The two networks are aligned on the union of the dyads that carry an edge in either network; dyads absent from both are excluded, so every metric is conditional on that union rather than on all possible dyads.

Value

A one-row base data.frame with columns pearson, cosine, mae, rmse, jaccard, edges_x, and edges_y. pearson and cosine are NA when either network's aligned weights have no variance or are all zero.

Examples

a <- simulate_network(nodes = 30, model = "bernoulli", probability = 0.1, seed = 1)
b <- simulate_network(nodes = 30, model = "bernoulli", probability = 0.1, seed = 2)
compare_networks(a, b)

simulab documentation built on Oct. 15, 2026, 5:08 p.m.