| to_df | R Documentation |
Convert cppRouting graph to data.frame
to_df(Graph, aux = FALSE, capacity = FALSE, alpha = FALSE, beta = FALSE)
Graph |
An object generated by cppRouting::makegraph() or cpp_simplify() function. |
aux |
logical. If |
capacity |
logical. If |
alpha |
logical. If |
beta |
logical. If |
Data.frame with from, to and dist column, plus any of aux/capacity/alpha/beta requested.
#Simple directed graph
edges<-data.frame(from=c(1,2,3,4,5,6,7,8),
to=c(0,1,2,3,6,7,8,5),
dist=c(1,1,1,1,1,1,1,1))
#Construct cppRouting graph
graph<-makegraph(edges,directed=TRUE)
#Convert cppRouting graph to data.frame
df<-to_df(graph)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.