I am trying to color coded my map with hex colors. Vietnam, Philippines, Indonesia: Hex - #404E57 Mongolia, Pakistan, Bangladesh, Myanmar, Sri Lanka: Hex - #A0A7AB. I want other countries to be grey and only the listed countries are color coded accordingly. What line of code should I add to do that, since I am new to ggplot map. Thank you for your time.
Here is my code:
ia_countries = read_csv('country_ia_3.csv') %>%
mutate(iso_a3 = countrycode(sourcevar = country, origin = 'country.name', destination = 'iso3c'))
ip_map = ne_countries(scale = "medium", returnclass = "sf") %>%
right_join(ia_countries, by = "iso_a3")
ggplot() +
geom_sf(data = ne_countries(scale = "medium", returnclass = "sf"), fill = 'grey95', colour = 'grey40') +
geom_sf(data = ip_map, colour = 'grey40') +
coord_sf(xlim = c(60,140), ylim = c(-15,50)) +
labs(x = NULL, y = NULL) +
geom_label_repel(data = ia_countries, aes(
x = long,
y = lat,
label = country
)) +
theme_minimal() +
theme(
panel.grid = element_blank(),
axis.text.x = element_blank(),
axis.text.y = element_blank(),
legend.position = "bottom"
)