match_na_raster {mop}R Documentation

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)

Arguments

layers

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

Value

A SpatRaster object with NA cells matching in all layers.

Examples

# 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)

[Package mop version 0.1.3 Index]