Last chance! 50% off unlimited learning
Sale ends in
NA
values with values of another rasterReplace NA
values (or another value) in SpatRaster (x
) with the values of SpatRaster (y
)
# S4 method for SpatRaster,SpatRaster
cover(x, y, value=NA, filename="", overwrite=FALSE, wopt=list(), ...)
SpatRaster
SpatRaster
numeric. The cell values in x
to be replaced by the values in y
character. Output filename. Optional
logical. If TRUE
, filename
is overwritten
list. Options for writing files as in writeRaster
additional arguments. None implemented
SpatRaster
# NOT RUN {
r1 <- r2 <- rast(ncols=36, nrows=18)
values(r1) <- 1:ncell(r1)
values(r2) <- runif(ncell(r2))
r2 <- classify(r2, cbind(-Inf, 0.5, NA))
r3 <- cover(r2, r1)
# }
Run the code above in your browser using DataLab