powered by
Compute the difference between consecutive layers in a SpatRaster.
# S4 method for SpatRaster diff(x, lag=1, filename="", ...)
SpatRaster
postive integer indicating which lag to use
character. Output filename
additional arguments for writing files as in writeRaster
writeRaster
# NOT RUN { s <- rast(system.file("ex/logo.tif", package="terra")) d <- diff(s) # }
Run the code above in your browser using DataLab