library(rworldmap)
library(fields)

World <- getMap()

a <- 1 : (360 * 180)
dim(a) <- c(lat = 180, lon = 360)
a <- t(a) # trick to display better the following tests:
lon = 1 : 360
lat = 1 : 180

image.plot(lon, lat, a)
plot(World, add = T)
map("world", add = T)

aa <- rbind(a, a)
image.plot(1:720, lat, aa, xlim = c(50, 390))
map("World", add = T)
plot(World, add = T)

map(wrap = c(50,390), fill = TRUE, col = a)



require (raster)
require (maps)
a  #random matrix
r <- raster(a, xmn = -179.5, xmx = 179.5, ymn = -89.5, ymx = 89.5,
           crs="+proj=longlat +datum=WGS84")
plot(r, wrap = c(50, 360))
map("world", wrap = c(50, 390), add = T, fill = TRUE, col = "white", bg = "white")
