diff: Lagged differences

diffR 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 writeRaster

Value

SpatRaster

Examples

s <- rast(system.file("ex/logo.tif", package="terra"))   
d <- diff(s)

terra documentation built on Oct. 14, 2024, 5:07 p.m.