upstreammat {riverdist} | R Documentation |
Upstream Distance Matrix
Description
Returns a matrix of upstream distance 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).
Usage
upstreammat(
seg,
vert,
rivers,
logical = NULL,
ID = NULL,
flowconnected = FALSE,
net = FALSE,
stopiferror = TRUE,
algorithm = NULL
)
Arguments
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, riverdirectionseq() will only return pairwise distances in which a specified condition is met. |
ID |
a vector of observation IDs for aid in interpreting the output table |
flowconnected |
If |
net |
Whether to calculate net upstream distance (net=TRUE) or total distance (net=FALSE, default). See upstream. |
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 ( |
Value
A matrix of upstream distances (numeric) with rows and columns
labeled by corresponding values of ID
. See upstream for additional information.
Note
Building routes from the river mouth to each river network segment and/or distance lookup tables will greatly reduce computation time (see buildsegroutes).
Author(s)
Matt Tyers
See Also
Examples
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"))
upstreammat(seg=fakefish$seg, vert=fakefish$vert, rivers=Gulk, logical=logi1)