Learn R Programming

ursa (version 3.9.4)

is.na: ‘No data’ values for raster images.

Description

The "Extract" function is.na creates mask for each band. In this mask value 1L corresponds to NA value in the source image, and value NA corresponds non-missing values in the source image. The "Replacement" function is.na<- assigns numerical value for cells with ‘no data’ value.

Usage

# S3 method for ursaRaster
is.na(x)

# S3 method for ursaRaster is.infinite(x)

# S3 method for ursaRaster is.nan(x)

# S3 method for ursaRaster is.na(x) <- value

Arguments

x

Object of class ursaRaster

value

Numeric.

Value

"Extract" functions is.na, is.infinite, is.nan return object of class ursaRaster.

"Replacement" function is.na<- modifies object of class ursaRaster.

Details

These functions are corresponded to local operators of map algebra.

Examples

Run this code
# NOT RUN {
session_grid(NULL)
session_grid(regrid(mul=1/4))
a <- ursa_dummy(nband=2,min=0,max=100)
print(a)
print(is.na(a))
a2 <- ursa_new(nband=2)
print(a2)
print(is.na(a2))
a3 <- a
a3[a3<30 | a3>70] <- NA
print(a3)
print(is.na(a3))
is.na(a3) <- 200
print(a3)
# }

Run the code above in your browser using DataLab