# NOT RUN {
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]
# }
Run the code above in your browser using DataLab