Learn R Programming

terra (version 1.1-17)

diff: diff

Description

Returns lagged differences.

Usage

# S4 method for SpatRaster
diff(x, filename="", ...)

Arguments

x

SpatRaster

filename

character. Output filename

...

additional arguments for writing files as in writeRaster

Value

SpatRaster

Examples

Run this code
# NOT RUN {
s <- rast(system.file("ex/logo.tif", package="terra"))   
d <- diff(s)
# }

Run the code above in your browser using DataLab