The flow() function uses a raster representing elevation to compute other rasters representing:
Flow accumulation;
Direction of flow;
Watershed basins;
Flooded areas; and/or
Topographic convergence (log of flow accumulation divided by local slope).
More details about the computations can be found at the help page for the GRASS tool r.terraflow] (see grassHelp("r.terraflow"))
Usage
# S4 method for class 'GRaster'
flow(
x,
direction = "multi",
return = "accumulation",
dirThreshold = Inf,
scratchDir = NULL
)Arguments
- x
A
GRasterwith a single layer, typically representing elevation.- direction
Character: Either
"single"or"multi". This indicates whether a single-direction flow or multi-direction flow model is used. The default is"multi". Partial matching is used and case is ignored.- return
Character vector: Indicates what rasters to return. Partial matching is used and case is ignored. Options include:
"accumulation"(default): Flow accumulation raster."basins": Watershed basins"direction": Flow direction"flooded": Flooded areas"TCI": Topographic convergence index"*": All of the above
- dirThreshold
Numeric (default is
Inf): For the multi-direction flow model, this indicates the amount of accumulated flow above which the single-direction flow rule is used to locate the egress of water from a cell. This is thed8cutparameter inr.stream.extract.- scratchDir
Character or
NULL(default): Directory in which to store temporary files. The GRASS toolr.terraflowmakes a lot of temporary files. If this isNULL, then a temporary folder in the user's working directory will be used (seegetwd()).
See also
flowPath(), streams(), the GRASS tool r.terraflow (see grassHelp("r.terraflow"))
