diff: Lagged differences

Description Usage Arguments Value Examples

Description

Compute the difference between consecutive layers in a SpatRaster.

Usage

1
2
## S4 method for signature 'SpatRaster'
diff(x, lag=1, filename="", ...)

Arguments

x

SpatRaster

lag

postive integer indicating which lag to use

filename

character. Output filename

...

additional arguments for writing files as in writeRaster

Value

SpatRaster

Examples

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

Example output

terra version 0.9.8

terra documentation built on Aug. 20, 2021, 9:07 a.m.