reclassifyMap: A function for re-classifying raster maps based on input...

View source: R/reclassifyMap.R

reclassifyMapR Documentation

A function for re-classifying raster maps based on input look-up table

Description

This function re-classifies an input raster maps based on input look-up table that specifies transition from map classes (or range of classes) to a new class (or range of classes)

Usage

reclassifyMap(fgrid,df)

Arguments

fgrid

Input raster map to be reclassified

df

Input look-up table for re-classification

Details

The look-up table should have at least two columns in which the first column contains the classes in the input map and the second column contains the new classes to be assigned

Value

The output is a reclassified raster map

Author(s)

Christian Thine Omuto

References

Robert Hijman. Raster Package in R. https://www.rdocumentation.org/packages/raster

See Also

classCode, classLUT, classnames

Examples

library(sp)
LUT=data.frame(map=c(1,2,3,4,5,6),new=c(100,20,30,40,60,80))
newmap=(suitabinput["depthcodes"])
newmap$depth=reclassifyMap(newmap["depthcodes"],LUT)
newmap$melon=depthSuit(newmap$depth,"melon")
summary(newmap$depth)
spplot(newmap["depth"])

soilassessment documentation built on July 9, 2023, 7:40 p.m.