I am trying to create a New Zealand map using this script with ggplot2 in R.
library(sf) #'simple features' package
library(leaflet) # web-embeddable interactive maps
library(ggplot2) # general purpose plotting
library(rnaturalearth) # map data
library(rnaturalearthdata)# map data
library(ggspatial) # scale bars and north arrows
#the package below was installed from source through github:
# devtools::install_github("ropensci/rnaturalearthhires"))
library(rnaturalearthhires)# map data
theme_set(theme_bw())
newzealand <- ne_countries(country="New Zealand", type="countries", scale='large', returnclass = "sf")
ggplot(data = newzealand) +
geom_sf()
Unfortunately, it is not working and all I get is a small version on the low right side of the plot (seems like it is on a scale of the world planisphere, see picture attached). If I tweak the script with other countries it works perfectly. Can someone help me? I have the feeling the map I am looking for is not present in the database the script use.
Thanks to everyone who can help.
Miriam
I tried to run the script but it didn't work