reclass | R Documentation |
re-class the base map to the target map
reclass(input, output, nthread = NULL, verbose = FALSE)
input |
(SpatRaster) an input terra raster to resample |
output |
(SpatRaster) the output grid to resample to |
nthread |
(integer) the number of thread to use for parallel. If |
verbose |
(logical) option to print out info for debugging. |
(matrix) the categorical matrix of target terra raster
library(APUpscale) library(terra) nlcd <- rast(system.file('extdata/nlcd_dukes.tif', package = "APUpscale")) output <- rast(ext(nlcd), crs = crs(nlcd), resolution = 1000, vals = NA) target_vals <- reclass(nlcd, output, nthread = 2) values(output) <- target_vals coltab(output) <- coltab(nlcd) plot(output)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.