Returns a matrix of calculated travel direction between every point and every other point of given river locations (segment and vertex), or of a subset. The mouth (lowest point) segment and vertex must be specified (see setmouth).
riverdirectionmat(seg, vert, rivers, logical = NULL, ID = NULL, flowconnected = FALSE, stopiferror = TRUE, algorithm = NULL)
seg | A vector of river locations (segment component). |
---|---|
vert | A vector of river locations (vertex component). |
rivers | The river network object to use |
logical | A boolean vector that can be used for subsetting - if used,
|
ID | a vector of observation IDs for aid in interpreting the output table |
flowconnected | If |
stopiferror | Whether or not to exit with an error if a route cannot be
found. If this is set to |
algorithm | Which route detection algorithm to use ( |
A matrix of directions (character) with rows and columns labeled by
corresponding values of ID
. See riverdirection for additional information.
Building routes from the river mouth to each river network segment and/or distance lookup tables will greatly reduce computation time (see buildsegroutes).
data(Gulk, fakefish) # Mouth must be specified Gulk$mouth$mouth.seg <- 1 Gulk$mouth$mouth.vert <- 1 logi1 <- (fakefish$flight.date==as.Date("2015-11-25")) riverdirectionmat(seg=fakefish$seg, vert=fakefish$vert, rivers=Gulk, logical=logi1)#> 91 92 93 94 95 96 97 98 99 100 #> 91 "0" "up" "up" "up" "up" "up" "up" "up" "down" "up" #> 92 "down" "0" "up" "down" "down" "down" "down" "down" "down" "down" #> 93 "down" "down" "0" "down" "down" "down" "down" "down" "down" "down" #> 94 "down" "up" "up" "0" "down" "up" "up" "up" "down" "up" #> 95 "down" "up" "up" "up" "0" "up" "up" "up" "down" "up" #> 96 "down" "up" "up" "down" "down" "0" "down" "down" "down" "down" #> 97 "down" "up" "up" "down" "down" "up" "0" "up" "down" "down" #> 98 "down" "up" "up" "down" "down" "up" "down" "0" "down" "down" #> 99 "up" "up" "up" "up" "up" "up" "up" "up" "0" "up" #> 100 "down" "up" "up" "down" "down" "up" "up" "up" "down" "0"