accumulate: Returns all points in the watershed connecting two points,...

View source: R/topology.r

accumulateR Documentation

Returns all points in the watershed connecting two points, accumulating a value between

Description

If direction is down, then the accumulated distances will reflect the distance from the 'upstream' point to each downstream point, and values will be positive. If direction is "up", then the distances will be negative and accumulate from 'downstream' to 'upstream'.

Usage

accumulate(
  ws,
  upstream,
  downstream = Inf,
  direction = c("down", "up"),
  variable = "length",
  parallel = FALSE
)

Arguments

ws

Watershed object

upstream

ID number of upstream point; if Inf ALL upstream pixels will be returned

downstream

ID of downstream point; if Inf ALL downstream pixels will be returned

direction

In which direction should the variable be accumulated; see 'details'

variable

The variable to accumulate

parallel

Boolean, should parallel processing be used?

Value

A matrix, first column connected pixelIDs, second the accumulated variable


mtalluto/WatershedTools documentation built on May 21, 2022, 7:49 p.m.