sf2igraph: Convert sf lines to an igraph object

View source: R/igraph.R

sf2igraphR Documentation

Convert sf lines to an igraph object

Description

Convert sf lines to an igraph object

Usage

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)

## Not run: 
data(nhd_sub)
tree <- sf2igraph(nhd_sub)
plot(tree$tree,
     edge.width = tree$weights,
     layout = igraph::layout_as_tree(tree$tree, mode = "in"))


## End(Not run)

jsta/streamnet documentation built on July 9, 2022, 9:02 p.m.