I am trying to place a world map on my current plots made by level plot. This plot was made as follows:
pretty=TRUE,par.settings=mapTheme, main="Historical five-day maximum
precipitation (mm/day) model mean")
The object "MFMeaner3" has the following attributes: class : RasterLayer
dimensions : 64, 128, 8192 (nrow, ncol, ncell)
resolution : 2.8125, 2.789327 (x, y)
extent : -181.4062, 178.5938, -89.25846, 89.25846 (xmin, xmax, ymin,
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
data source : in memory
names : layer
values : 0.1583802, 164.2064 (min, max)
Here was my attempt to place a world map overlay on the above plot:
MFplot4 + layer(sp.lines(world.outlines.sp,col="black",lwd=0.5))However, this leads to the following error:
Error: Attempted to create layer with no stat.
I also tried placing a simple world map using this:
MFplot4 + plot(wrld_simpl)
But I receive this error:
Error in UseMethod("as.layer") :
no applicable method for 'as.layer' applied to an object of class "NULL"
Why would these errors occur?
Any assistance with this would be extremely appreciated!
[[alternative HTML version deleted]]