which: Which cells are TRUE?

which.lyrR Documentation

Which cells are TRUE?

Description

This method returns a single layer SpatRaster with cell values indicating the first layer in the input that is TRUE. All numbers that are not zero (or FALSE), are considered to be TRUE.

Usage

## S4 method for signature 'SpatRaster'
which.lyr(x)

Arguments

x

SpatRaster

Value

SpatRaster

See Also

isTRUE, which, See Summary-methods for which.min and which.max

Examples

s <- rast(system.file("ex/logo.tif", package="terra"))   
x <- which.lyr(s > 100)

rspatial/terra documentation built on April 28, 2024, 12:22 a.m.