powered by
This method returns the cell numbers for the cells with the min or max values of each layer in a SpatRaster.
# S4 method for SpatRaster where.min(x, values=TRUE, list=FALSE)# S4 method for SpatRaster where.max(x, values=TRUE, list=FALSE)
# S4 method for SpatRaster where.max(x, values=TRUE, list=FALSE)
matrix or list
SpatRaster
logical. If TRUE the min or max values are also returned
TRUE
logical. If TRUE a list is returned instead of a matrix
which and Summary-methods for which.min and which.max
which
Summary-methods
which.min
which.max
f <- system.file("ex/elev.tif", package="terra") r <- rast(f) where.min(r)
Run the code above in your browser using DataLab