Skip to content

st_network_cost - How to index "to" argument when "duplicated values in argument 'to' were removed. " #153

Closed Answered by luukvdmeer
zackarno asked this question in Q&A
Discussion options

You must be logged in to vote

Just as a (late) update: since version 0.6 the st_network_cost() does not remove duplicated nodes in the 'to' argument anymore. See https://luukvdmeer.github.io/sfnetworks/news/index.html#sfnetworks-v060-coerde. Hence, the resulting cost matrix will have dimensions nxm where n is the number of provided 'from' nodes and m the number of provided 'to' nodes (i.e. ncol(cost_matrix) == nrow(to_argument)). As you would intuitively expect. Of course, if e.g. 'to' nodes m1 and m2 are the same node (or a different node at the same location) they will of course have the same cost value for each 'from' node ni.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@zackarno
Comment options

@zackarno
Comment options

@zackarno
Comment options

@agila5
Comment options

agila5 Jun 13, 2021
Collaborator

Comment options

You must be logged in to vote
0 replies
Answer selected by luukvdmeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants