Learn R Programming

terra (version 1.8-80)

not.na: is not NA

Description

Shortcut method to avoid the two-step !is.na(x)

Usage

# S4 method for SpatRaster
not.na(x, falseNA=FALSE, filename="", ...)

Arguments

Value

SpatRaster

See Also

Compare-methods

Examples

Run this code
r <- rast(ncols=5, nrows=5, vals=1, ext=c(0,1,0,1))
r[10:20] <- NA
x <- not.na(r)
y <- not.na(r, falseNA=TRUE)
unique(values(c(x, y)))

Run the code above in your browser using DataLab