reclass: Re-class the target map

View source: R/reclass.R

reclassR Documentation

Re-class the target map

Description

re-class the base map to the target map

Usage

reclass(input, output, nthread = NULL, verbose = FALSE)

Arguments

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 NULL, the all available cores in the machine will be used. Default to NULL.

verbose

(logical) option to print out info for debugging.

Value

(matrix) the categorical matrix of target terra raster

Examples

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)

LLeiSong/APUpscale documentation built on June 2, 2022, 12:28 p.m.