Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dodgr_uncontract_graph

dodgr_uncontract_graph


Description

Revert a contracted graph created with dodgr_contract_graph back to the full, uncontracted version. This function is mostly used for the side effect of mapping any new columns inserted on to the contracted graph back on to the original graph, as demonstrated in the example.

Usage

dodgr_uncontract_graph(graph)

Arguments

graph

A contracted graph created from dodgr_contract_graph.

Value

A single data.frame representing the equivalent original, uncontracted graph.

See Also

Other modification: dodgr_components(), dodgr_contract_graph()

Examples

graph0 <- weight_streetnet (hampi)
nrow (graph0) # 5,845
graph1 <- dodgr_contract_graph (graph0)
nrow (graph1) # 686
graph2 <- dodgr_uncontract_graph (graph1)
nrow (graph2) # 5,845

# Insert new data on to the contracted graph and uncontract it:
graph1$new_col <- runif (nrow (graph1))
graph3 <- dodgr_uncontract_graph (graph1)
# graph3 is then the uncontracted graph which includes "new_col" as well
dim (graph0); dim (graph3)

dodgr

Distances on Directed Graphs

v0.2.11
GPL-3
Authors
Mark Padgham [aut, cre], Andreas Petutschnig [aut], Robin Lovelace [ctb], Andrew Smith [ctb], Malcolm Morgan [ctb], Shane Saunders [cph] (Original author of included code for priority heaps)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.