-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
See reprex below:
library(dodgr)
tmp <- hampi |> weight_streetnet() |> dodgr_centrality()
colnames(tmp)
#> [1] "geom_num" "edge_id" "from_id" "from_lon"
#> [5] "from_lat" "to_id" "to_lon" "to_lat"
#> [9] "d" "d_weighted" "highway" "way_id"
#> [13] "component" "bicycle" "time" "time_weighted"
#> [17] "centrality"
# Now convert to igraph structure
library(igraph)
dodgr_to_igraph(tmp) |> edge_attr() |> names()
#> [1] "weight" "d_weighted" "time" "time_weighted"
#> [5] "xfr" "yfr" "xto" "yto"
#> [9] "component"Created on 2024-09-24 with reprex v2.0.2
As we can see, the centrality column disappears when converting dodgr to igraph. AFAICT, the column is dropped here:
Line 158 in ac1eec5
| graph <- graph [, do.call (c, gr_cols [!is.na (gr_cols)])] |
Happy to create a PR but I'm not sure what is the ideal API. Maybe a new argument that permits the addition of "extra" column in the edge_attribute field?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels