make_raster_lut | R Documentation |
Make a neighborhood LUT, where each cell value contains the 1-d address of the closest non-missing cell (which might be itself).
make_raster_lut(
x = volcano_single(threshold = 120),
mask_value = NA,
nonreassigned_value = "cellnumber"
)
x |
stars object, only the first layer of the first attribute is used. |
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. |
stars of cell addresses. Where the input, x, 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(stars)
library(twinkle)
v = volcano_single(threshold = 120)
lut <- make_raster_lut(v)
z <- c(mask, lut)
names(z) <- c("mask", "lut")
mplot(z)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.