Closed loreabad6 closed 2 years ago
I dont think we have to set its default conditionally, since this argument is either way ignored when the input network is undirected. See https://igraph.org/r/html/latest/distances.html So the default can just be "out", and mention in the parameter description that this parameter is ignored when the network is undirected.
Minor comment on this: the word mode in a transport context often means 'mode of transport'.
I agree that is confusing. We could use another name, e.g. direction = "in"/"out"/"all"
. Since ...
is forwarded to igraph we should maybe give a warning that when "mode" is included in ... it is ignored and the user should set the "direction" argument instead.
Implemented in v0.6.0, see https://luukvdmeer.github.io/sfnetworks/articles/sfn04_routing.html#retrieving-an-od-cost-matrix
Is your feature request related to a problem? Please describe. Currently
st_network_cost()
has the default behavior, inherited fromigraph::distances()
of calculating costs by traveling each edge in both directions, i.e. an undirected network, even if the input network is directed.Describe the solution you'd like That
st_network_cost()
includes themode
argument, and that its default value is set tomode="both"
for undirected networks, andmode="out"
for directed networks (considering only outbound edges, can be changed tomode="in"
to consider only inbound edges), with its corresponding documentation.