I need to color in just Costa Rica in a cropped world map of just Central America.
The code I've already written is included below... I would like to be able to do it with the ggplot2 and sf libraries.
library("ggplot2")
theme_set(theme_bw())
library("sf")
library("rnaturalearth")
library("rnaturalearthdata")
library("maps")
world <- ne_countries(scale='medium',returnclass = 'sf')
class(world)
(CentralAmerica <- ggplot(data = world) +
geom_sf() +
coord_sf(xlim = c(-60, -120), ylim = c(5, 35), expand = FALSE) +
scale_fill_viridis_d(option = "plasma") +
theme(panel.background = element_rect(fill = "azure"),
panel.border = element_rect(fill = NA)))