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.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-12-19 11:00:00 +0000
Seen: 12 times
Last updated: Jan 25 '22
What is Fullscreen Activity in Android?
What does 'Invalid argument (callbackUrlScheme): must be a valid URL scheme' mean?
How can SSL passthrough be implemented with Traefik in Kubernetes?
What is authentication using C# ASP.NET Core MVC?
What are the steps to create a semi-circular shape divided into 8 parts using HTML, CSS, or SVG?
What is the way to name parameters and REST API urls in Spring Boot?
How can ASP.NET Core be configured to incorporate various authorization strategies?