View source: R/reclassifyMap.R
reclassifyMap | R Documentation |
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)
reclassifyMap(fgrid,df)
fgrid |
Input raster map to be reclassified |
df |
Input look-up table for re-classification |
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
The output is a reclassified raster map
Christian Thine Omuto
Robert Hijman. Raster Package in R. https://www.rdocumentation.org/packages/raster
classCode
, classLUT
, classnames
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"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.