powered by
Linear scaling of raster cell values between a specified minimum and maximum value.
# S4 method for SpatRaster scale_linear(x, min=0, max=1, filename="", ...)
SpatRaster
minimum value to scale to
maximum value to scale to
character. Output filename
additional arguments for writing files as in writeRaster
writeRaster
scale
r <- rast(system.file("ex/logo.tif", package="terra")) s1 <- scale_linear(r) s2 <- scale_linear(r, 1, 10)
Run the code above in your browser using DataLab