I would like to merge some polygons together
- Morocco with Western Sahara
- Sudan with South Sudan
map_data('world')
I would like to merge some polygons together
map_data('world')
library(ggplot2)
library(dplyr)
world_map <- map_data("world")
merged_map <- world_map |>
mutate(region = case_when(
region %in% c("Morocco", "Western Sahara") ~ "Morocco",
region %in% c("Sudan", "South Sudan") ~ "Sudan",
TRUE ~ region
))
ggplot(merged_map, aes(x = long, y = lat, group = group, fill = region)) +
geom_polygon(color = "black") +
coord_fixed() +
theme_minimal()