View source: R/homogenize_na.R
homogenize_na | R Documentation |
Homogenize cells with NAs across all layers
homogenize_na(x)
x |
A SpatRaster. |
Homogenize cells with NAs across all layers in a SpatRaster so that in the resulting SpatRaster all layers have the same cells with NAa
a SpatRaster
## Not run:
#' require(terra)
somevar <- system.file("external/somevar.tif", package = "flexsdm")
somevar <- terra::rast(somevar)
somevar2 <- homogenize_na(somevar)
par(mfrow = c(2, 1))
plot(somevar$CFP_4)
plot(somevar2$CFP_4)
par(mfrow = c(1, 1))
# In somevar2 all layers have the same cells with NAs
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.