Lagged differences
diff.Rd
Compute the difference between consecutive layers in a SpatRaster.
Arguments
- x
SpatRaster
- lag
positive integer indicating which lag to use
- filename
character. Output filename
- ...
additional arguments for writing files as in
writeRaster
Examples
s <- rast(system.file("ex/logo.tif", package="terra"))
d <- diff(s)