Closed loreabad6 closed 2 years ago
Should it be the default to return names whenever a name column is present in the nodes table? Or should it only do that e.g. when you would set use_names = TRUE
?
Should it be the default to return names whenever a name column is present in the nodes table?
IMO yes.
Implemented in v0.6.0
Is your feature request related to a problem? Please describe.
Current behavior is that when we have an sfnetwork with a node column named
name
, the nodes will automatically take that name as identifier of the nodes.This behavior can be used in
st_network_cost()
andst_network_paths()
. Forst_network_cost()
this returns a named cost matrix, which can come in handy when interpreting the results.However, these names are lost when calling
st_network_paths()
.These works when calling
igraph::shortest_paths()
This happens because inside
st_network_paths()
, this function is called:Which converts the igraph result into integers.
Describe the solution you’d like
It would be nice if we could return a named vector within the output of st_network_paths().