if (requireNamespace("igraph", quietly = TRUE) &&
requireNamespace("ggplot2", quietly = TRUE)) {
g1 <- igraph::sample_pa(40, m = 2, directed = FALSE)
g2 <- igraph::sample_gnp(40, 0.15)
ggplot_robustness(
"Teaching network" = g1,
"Collaborative network" = g2,
n_iter = 20
)
}
Run the code above in your browser using DataLab