Is there a way to export maps created using ggplot with ggmap and and the sf package as georeferenced pdfs? I am making maps that combine a basemap with polygon, point, and label layers using ggmap and the sf package, is it possible to export the resulting map as a georeferenced pdf for use in apps like avenza. The maps would be similar to this example using the nc example in the sf package.
library(tidyverse)
library(sf)
library(ggmap)
POLYS <- st_read(system.file("shape/nc.shp", package="sf")) %>% st_transform(4326)
POINTS <- st_centroid(POLYS)
BASEMAP <- get_map(location = unname(st_bbox(POLYS)), zoom = 8)
EX_MAP <- ggmap(BASEMAP)+
geom_sf(data=POLYS, inherit.aes = F, fill=NA)+
geom_sf(data=POINTS, inherit.aes = F)+
geom_sf_label(data = POINTS, inherit.aes = F, nudge_y = 0.02, aes(label=NAME), size=2)
ggsave(EX_MAP, filename = "EX_MAP.pdf")