basinsort: Orders drainage basins by elevation

Description Usage Arguments Value Examples

View source: R/cadtools.R

Description

basinsort is an internal function used by basindelin() and basinmerge() to number drainage basins sequentially from lowest elevation (of lowest point) to highest.

Usage

1
basinsort(dem, basins)

Arguments

dem

a raster object, two-dimensional array or matrix of elevations.

basins

a raster object, two-dimensional array or matrix of basins numbered as integers.

Value

a raster object, two-dimensional array or matrix of sequentially numbered basins

Examples

1
2
3
basins <- matrix(c(1:4), nrow = 2, ncol = 2)
dem <- matrix(c(4:1), nrow = 2, ncol = 2)
basinsort(dem, basins)

ilyamaclean/microclima documentation built on Dec. 14, 2018, 3:10 p.m.