make_raster_lut | R Documentation |
Each cell of a lut contains a cell address of the closest
cell covered by a non-mask value in the input. Obviously, cells already
covered by non-mask will have it's original cell number. Cells covered by
mask_value
in the input will have a cell number of the closest
non-mask cell.
make_raster_lut( x = make_dummy_mask(), mask_value = NA_real_, nonreassigned_value = "cellnumber" )
x |
raster mask |
mask_value |
numeric the value of masked areas, by default NA |
nonreassigned_value |
either "cellnumber" which indicates cell number should be used or some numeric value like NA. |
Note this assigns the closest cell value which is a 1-d index into 2-d space.
raster of cell addresses. Where the input, R, had non-mask values the cell addresses point to the input cell. Where the input had mask-valued cells, the output cell addresses point to the nearest non-mask cells in the input.
## Not run: library(terra) mask <- make_dummy_mask() lut <- make_raster_lut(mask) z <- c(mask, lut) names(z) <- c("mask", "lut") plot(z) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.