[R-sig-Geo] using mapview to plot raster with integer values

Paulo Flores Ribeiro p@u|o@||ore@@m@|| @end|ng |rom gm@||@com
Fri Nov 12 14:09:29 CET 2021


I'm trying to plot a raster where pixels can only assume integer values 
1, 2 or 3, identifying 3 land use classes. The map does fine when 
plotted with the base r function: plot(rastername). However, I would 
like to use mapview (or another package for interactive maps) but it 
creates pixels with non-integer values on transition boundaries between 
classes (eg between classes 1 and 2 it creates a transition zone with 
some pixels assuming non-integer values 1.2033, 1.4221, 1.7119, etc.). 
Any way to avoid this? Thanks in advance, PauloFR



More information about the R-sig-Geo mailing list