net <- data.frame(
from = 1:2,
to = 2:3,
length = 1,
directed = TRUE,
stringsAsFactors = F
)
gr <- igraph::graph_from_data_frame(net)
simplify_igraph_network(gr)
net <- data.frame(
from = c(1, 2, 3, 1),
to = c(2, 3, 1, 4),
length = 1,
directed = TRUE,
stringsAsFactors = F
)
gr <- igraph::graph_from_data_frame(net)
simplify_igraph_network(gr)
net <- data.frame(
from = c(1, 2, 3, 4),
to = c(2, 3, 1, 5),
length = 1,
directed = TRUE,
stringsAsFactors = F
)
gr <- igraph::graph_from_data_frame(net)
simplify_igraph_network(gr)
Run the code above in your browser using DataLab