diff {terra} | R Documentation |
Lagged differences
Description
Compute the difference between consecutive layers in a SpatRaster.
Usage
## S4 method for signature 'SpatRaster'
diff(x, lag=1, filename="", ...)
Arguments
x |
SpatRaster |
lag |
positive integer indicating which lag to use |
filename |
character. Output filename |
... |
additional arguments for writing files as in |
Value
SpatRaster
Examples
s <- rast(system.file("ex/logo.tif", package="terra"))
d <- diff(s)
[Package terra version 1.7-78 Index]