Change a categorical layer into one or more numerical layers. With as.numeric you can transfer the active category values to cell values in a non-categorical SpatRaster. catalyze creates new layers for each category.
methods
## S4 method for signature 'SpatRaster'as.numeric(x, index=NULL, filename="",...)## S4 method for signature 'SpatRaster'catalyze(x, filename="",...)
Arguments
x: SpatRaster
index: positive integer or category indicating the category to use. If NULL the active category is used
filename: character. Output filename
...: additional arguments for writing files as in writeRaster