Is your feature request related to a problem? Please describe.
In igraph::distances() it is not allowed to have duplicated node indices in the to argument. See here.
to: Numeric vector, the vertices to which the shortest paths will be calculated. By default it includes all vertices. Note that for distances every vertex must be included here at most once
For our wrapper st_network_cost() we have the same requirement, because we simply call the igraph function. However, st_network_cost() allows to provide spatial points as to argument, which will then internally be "represented" by their nearest node. Two different points may have the same nearest node, however. In that case one of the points will be ignored by st_network_cost() and the warning Duplicated values in argument 'to' were removed is given. The returned matrix will not have the same amount of columns as the number of points you forwarded. That can be super annoying.
Describe the solution you'd like
Because igraph does not support duplicated to indices, we must remove them, as we already do. However, afterwards we could just insert the missing column again in the matrix, such that the user does not even notice it.
Is your feature request related to a problem? Please describe. In
igraph::distances()
it is not allowed to have duplicated node indices in the to argument. See here.For our wrapper
st_network_cost()
we have the same requirement, because we simply call the igraph function. However,st_network_cost()
allows to provide spatial points as to argument, which will then internally be "represented" by their nearest node. Two different points may have the same nearest node, however. In that case one of the points will be ignored byst_network_cost()
and the warningDuplicated values in argument 'to' were removed
is given. The returned matrix will not have the same amount of columns as the number of points you forwarded. That can be super annoying.Describe the solution you'd like Because
igraph
does not support duplicated to indices, we must remove them, as we already do. However, afterwards we could just insert the missing column again in the matrix, such that the user does not even notice it.