I have a raster r
representing values from 0 to 50 for the world. There are large areas with missing values NA
values, including:
- All oceans
- Large inland regions such as deserts
The problem is that when I plot r
all NAs appear with the same colour regardless of whether they are oceans or deserts. This does not look nice, so I want to display inland NAs in a different colour than oceans.
I was thinking perhaps I could grab a map representing continents (e.g. map("world")
), and create a layer of all NAs in r
that fall inside continents. Then, I can just overlap this new raster on top of r
in a different colour.
How can I create a new raster with all the inland missing values in a raster?