During the transition from raster to terra, some functions are not drop in
replacements, such as minValue and maxValue became terra::minmax. This
helper allows one function to be used, which calls the correct max or min
function, depending on whether the object is a Raster or SpatRaster.
Usage
minFn(x)
maxFn(x)
dataType2(x, ...)
nlayers2(x)
values2(x, ...)
Value
A vector (not matrix as in terra::minmax) with the minimum or maximum
value on the Raster or SpatRaster, one value per layer.
Arguments
x
A Raster or SpatRaster object.
...
Passed to the functions in raster or terra, as needed.