I'm trying to make a map of NZ and the Chatham Islands similar to this one specifically using the package ggOceanMaps (bc I need that style of bathymetry) and the function basemaps().
However, the function doesn't allow me to go over the dateline. Is there anyway around this?
This is the code I've got:
install.packages(c("ggOceanMapsData", "ggOceanMaps"),
repos = c("https://cloud.r-project.org", "https://mikkovihtakari.github.io/drat")
)
library(ggOceanMaps)
nzmap1<-basemap(limits = c(165, 180, -32, -51), bathymetry = TRUE,resolution = "high",
land.col="darkseagreen4",lon.interval = 5,lat.interval = 5)+
xlab("Longitude")+ylab("Latitude")
nzmap1
So it works fine from 165 to 180 degrees longitude, but if I try go beyond 180/-180 (ideally I'd like to go to -170) it comes out with the error code:
Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
polygon edge not found
Thanks, Tory
