Skip to contents

This function adds a legend to a categorical raster file, often containing information about land cover or planning units.

Usage

add_legend_to_categorical_raster(raster_file, lookup_table, year = NULL)

Arguments

raster_file

A categorical raster file (an object of class SpatRaster)

lookup_table

A corresponding lookup table of descriptions for each class category

year

An optional year to be associated with the raster file

Value

A raster file that contains descriptions for each class category

Examples

if (FALSE) {
add_legend_to_categorical_raster(raster_file = kalbar_11,
              lookup_table = lc_lookup_klhk,
              year = 2011) %>%
              plot()
}