Convert sf lines to an igraph object

sf2igraph(sf_lines, tolerance = 1)

Arguments

sf_lines

sf lines object

tolerance

numeric snapping distance for lines to be considered connected

Examples

tree    <- create_reversed_tree(15)
tree_sf <- igraph2sf(tree)
tree    <- sf2igraph(tree_sf, tolerance = 1)

if (FALSE) {
data(nhd_sub)
tree <- sf2igraph(nhd_sub)
plot(tree$tree,
     edge.width = tree$weights,
     layout = igraph::layout_as_tree(tree$tree, mode = "in"))

}