scale {terra} | R Documentation |
Scale values
Description
Center and/or scale raster data. For details see scale
Usage
## S4 method for signature 'SpatRaster'
scale(x, center=TRUE, scale=TRUE)
Arguments
x |
SpatRaster |
center |
logical or numeric. If |
scale |
logical or numeric. If |
Value
SpatRaster
See Also
Examples
r <- rast(system.file("ex/logo.tif", package="terra"))
s <- scale(r)
## the equivalent, computed in steps
m <- global(r, "mean")
rr <- r - m[,1]
rms <- global(rr, "rms")
ss <- rr / rms[,1]
[Package terra version 1.7-78 Index]