1 | initial version |
To combine mono-colored raster layers in R that have overlapping data using level plot, you can follow these steps:
library(raster)
library(lattice)
r1 <- raster("raster1.tif")
r2 <- raster("raster2.tif")
r_merged <- merge(r1, r2)
levelplot(r_merged)
The resulting plot will show the combination of the two original raster layers with overlapping data. To customize the color scheme, you can use the "col.regions" parameter in levelplot(). For example:
levelplot(r_merged, col.regions = rev(terrain.colors(255)))
This will use a color scheme from the "terrain.colors" function and reverse the order of the colors.