このディスカッションに従って、これを行う 1 つの方法があります。これは、SpatialPolygonsDataFrame を、NA で区切られたポリゴン座標の 1 つのマトリックスに分割することで構成されます。次に、これを を使用してレベルプロットにプロットしpanel.polygon
ます。
library(maptools)
a <- matrix(rnorm(360*180),nrow=360,ncol=180) #Some random data (=your airtemp)
b <- readShapeSpatial("110-m_land.shp") #I used here a world map from Natural Earth.
ここからが楽しみの始まりです。
lb <- as(b, "SpatialPolygons")
llb <- slot(lb, "polygons")
B <- lapply(llb, slot, "Polygons") #At this point we have a list of SpatialPolygons
coords <- matrix(nrow=0, ncol=2)
for (i in seq_along(B)){
for (j in seq_along(B[[i]])) {
crds <- rbind(slot(B[[i]][[j]], "coords"), c(NA, NA)) #the NAs are used to separate the lines
coords <- rbind(coords, crds)
}
}
coords[,1] <- coords[,1]+180 # Because here your levelplot will be ranging from 0 to 360°
coords[,2] <- coords[,2]+90 # and 0 to 180° instead of -180 to 180 and -90 to 90
そして、プロットが来ます:
levelplot(a, panel=function(...){
panel.levelplot(...)
panel.polygon(coords)})
ラティスの考え方は、引数でプロット関数を定義することですpanel
(この件に関する完全な説明については、を参照?xyplot
してください)。levelplot 自体の関数はlevelplot
.

もちろん、あなたの場合、base
グラフィックスを使用してこれをプロットする方が簡単に思えます:
image(seq(-180,180,by=1),seq(-90,90,by=1),a)
plot(b, add=TRUE)
