minmax: Get or compute the minimum and maximum cell values

Description Usage Arguments Value Examples

Description

The minimum and maximum value of a SpatRaster are returned or computed (from a file on disk if necessary) and stored in the object.

Usage

1
2
3
4
## S4 method for signature 'SpatRaster'
minmax(x)
## S4 method for signature 'SpatRaster'
setMinMax(x, force=FALSE)

Arguments

x

SpatRaster

force

logical. If TRUE min and max values are recomputed even if already avaialbe

Value

setMinMax: nothing. Used for the side-effect of computing the minimum and maximum values of a SpatRaster

minmax: numeric matrix of minimum and maximum cell values by layer

Examples

1
2
3
 
r <- rast(system.file("ex/elev.tif", package="terra"))
minmax(r)

terra documentation built on Oct. 11, 2021, 9:09 a.m.