I'm using igraph_to_dodgr() to prepare a network for using with dodgr. I noticed some of the column names don't look quite right and the output wasn't compatible with dodgr_distances() or other functions. I've tried to create a reprex below, I think the columns like x_from should be named from_x, possibly from tweaking this line and the same for the "to" columns.
I can submit a PR if you'd like.
library(dodgr)
#> Warning: package 'dodgr' was built under R version 4.5.3
graph <- weight_streetnet(hampi)
graph2 <- graph |>
dodgr_to_igraph() |>
igraph_to_dodgr()
#> Loading required namespace: igraph
names(graph2)
#> [1] "edge_id" "from_id" "to_id" "weight"
#> [5] "d_weighted" "time" "time_weighted" "component"
#> [9] "x_from" "y_from" "n_from" "x_to"
#> [13] "y_to" "n_to"
dodgr_distances(graph, from = "2398957768", to = "1390214848")
#> 1390214848
#> 2398957768 524.0256
dodgr_distances(graph2, from = "2398957768", to = "1390214848")
#> Error in `find_d_col()`:
#> ! Unable to determine distance column in graph
Created on 2026-03-31 with reprex v2.1.1
I'm using
igraph_to_dodgr()to prepare a network for using with dodgr. I noticed some of the column names don't look quite right and the output wasn't compatible withdodgr_distances()or other functions. I've tried to create a reprex below, I think the columns likex_fromshould be namedfrom_x, possibly from tweaking this line and the same for the "to" columns.I can submit a PR if you'd like.
Created on 2026-03-31 with reprex v2.1.1