Replaces the edges in a cograph_network object. Expects a data frame with from, to, and optionally weight columns. Updates the from, to, weight vectors and n_edges.
Examples
mat <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
net <- as_cograph(mat)
new_edges <- data.frame(from = c(1, 2), to = c(2, 3), weight = c(0.5, 0.8))
net <- set_edges(net, new_edges)
get_edges(net)
#> from to weight
#> 1 1 2 0.5
#> 2 2 3 0.8