I'm trying to include a map of the shoreline, and possibly also the country boundaries, on top of a levelplot with latitude and longitude coordinates.
The code I have so far for the levelplot is:
library(lattice)
library(ncdf4)
ncin <- nc_open("testplot.nc")
tp <- ncvar_get(ncin,"tp")
lon <- ncvar_get(ncin,"longitude")
lat <- ncvar_get(ncin,"latitude")
grid <- expand.grid(lon=lon, lat=lat)
levelplot(tp ~ lon * lat, data=grid)
The image that I get is this:
How can I get include a geographical map to the plot?
Update: I want the slice of the earth between 37°-31°N and 34°-31°E on the plot. Only the shorelines and country borders, so that you are still able to see the colour shading.
Thank you.