Learn R Programming

mop (version 0.1.3)

match_na_raster: Match NA cells for all layers in SpatRaster

Description

Option to match cells with NA values in a SpatRaster with multiple layers.

Usage

match_na_raster(layers)

Value

A SpatRaster object with NA cells matching in all layers.

Arguments

layers

a SpatRaster object containing two or more variables to be matched.

Examples

Run this code
# data
layers <- terra::rast(system.file("extdata", "reference_layers.tif",
                      package = "mop"))

# add NA in some places
layers[20:24, 10:16][, 3] <- NA
terra::plot(layers)

# match NAs
matched <- match_na_raster(layers)
terra::plot(matched)

Run the code above in your browser using DataLab