adj <- matrix(c(0, .5, .8, 0,
.5, 0, .3, .6,
.8, .3, 0, .4,
0, .6, .4, 0), 4, 4, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C", "D")
# One call, named arguments, a tidy table out
as.data.frame(threshold_edges(adj, minimum = 0.4))
# Verbs compose
adj |>
threshold_edges(minimum = 0.4) |>
remove_isolates() |>
mutate_nodes(deg = degree) |>
as.data.frame(what = "nodes")
Run the code above in your browser using DataLab