Closed fvaux closed 11 months ago
Could you reproject your data?
new_zealand |>
st_transform("EPSG:3851") |>
ggplot() +
geom_sf()
Thanks, I think that must be the solution. Would you transform the latitude and longitude data for EPSG:3851 to make that plotting work?
Yes. Another option would be to do:
chatam <- new_zealand |>
st_cast("POLYGON") |>
slice(5:9)
st_geometry(chatam) <- st_geometry(chatam) + c(360, 0)
st_crs(chatam) <- "EPSG:4326"
But it hacking hard :)
Great, thank you! Will try both solutions.
Hello, I'm learning to use rnaturalearth, and I want to be able to plot New Zealand with the Chatham Islands and Subantarctic Islands in their normal positions.
However, when I run:
sp::plot(ne_states(country = "new zealand"))
The Chatham Islands are on the far left.Then, when I try to use the coord_sf function to change the zoom on my plot, I'm unsure how to include the Chatham Islands.
Is there an easy solution?