Learn R Programming

terra (version 1.5-34)

not.na: is not NA

Description

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

Usage

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

Arguments

x

SpatRaster

filename

character. Output filename

...

additional arguments for writing files as in writeRaster

Value

SpatRaster

Examples

Run this code
# NOT RUN {
r <- rast(ncols=10, nrows=10, vals=1)
r[10:20] <- NA
x <- not.na(r)
# }

Run the code above in your browser using DataLab