where {terra}R Documentation

Where are the cells with the min or max values?

Description

This method returns the cell numbers for the cells with the min or max values of a SpatRaster.

Usage

## S4 method for signature 'SpatRaster'
where.min(x, list)
## S4 method for signature 'SpatRaster'
where.max(x, list)

Arguments

x

SpatRaster

list

logical. If TRUE a list is returned instead of a matrix

Value

matrix or list

See Also

which and Summary-methods for which.min and which.max

Examples

Run examples

f <- system.file("ex/elev.tif", package="terra")
r <- rast(f)
where.min(r)

[Package terra version 1.5-34 Index]