downstreamDist | R Documentation |
For each site, this function identifies the other sites that are downstream of it and computes a 'distance' between each site and all of its downstream sites. By default, this is river, distance, computed by summing the length of stream between the two sites. For any entry in this distance matrix [i,j], the value is either a nonzero number giving the downstream distance from site i to site j, or zero, indicating that j is not downstream of i.
downstreamDist(ws, x, variable = "length", fun = sum)
ws |
A watershed |
x |
A vector of pixel ids |
variable |
The variable to use for the distance metric |
fun |
The function to apply between each pair of sites |
For a more general (and much slower) distance computation, see [wsDistance()]
A site by site distance [Matrix::sparseMatrix()]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.