| dodgr_deduplicate_graph | R Documentation |
Graph may have duplicated edges, particularly when extracted as dodgr_streetnet objects. This function de-duplicates any repeated edges, reducing weighted distances and times to the minimal values from all duplicates.
dodgr_deduplicate_graph(graph)
graph |
Any 'dodgr' graph or network. |
A potentially modified version of graph, with any formerly duplicated edges reduces to single rows containing minimal weighted distances and times.
Other conversion:
dodgr_to_igraph(),
dodgr_to_sf(),
dodgr_to_sfc(),
dodgr_to_tidygraph(),
igraph_to_dodgr()
net0 <- weight_streetnet (hampi, wt_profile = "foot")
nrow (net0)
# Duplicate part of input data:
h2 <- rbind (hampi, hampi [1, ])
net1 <- weight_streetnet (h2, wt_profile = "foot")
nrow (net1) # network then has more edges
net2 <- dodgr_deduplicate_graph (net1)
nrow (net2)
stopifnot (identical (nrow (net0), nrow (net2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.