Learn R Programming

terra (version 0.8-5)

range: Get or compute the minimum and maximum cell values

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

# S4 method for SpatRaster
minmax(x)
# S4 method for SpatRaster
setMinMax(x)

Arguments

x

SpatRaster

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

Run this code
# NOT RUN {
r <- rast(system.file("ex/test.tif", package="terra"))
minmax(r)
# }

Run the code above in your browser using DataLab