R: diff

diff {terra} | R Documentation

## diff

### Description

Returns lagged differences.

### Usage

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

### Arguments

`x` | SpatRaster
`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)

[Package terra version 1.2-10 Index]