ggplot2shapefilechoroplethrnaturalearth

rnaturalearth lists three Belgian regions instead of Belgium. How to fix?


I am using the rnaturalearth and rnaturalearthdata for plotting choropleth maps. There is one problem: rnaturalearth lists the three Belgian regions (Brussels, Flemish and Walloon) instead of Belgian as a country. Is there a possibility to correct this manually and combining the three regions to the country Belgium as a whole?

It really causes problems, when I want to plot data regarding European countries and it is not possible to plot the data for Belgium correctly. So I had to rename Belgium in my data to e.g. Brussels to be able to plot the data - leaving white spaces on the map for the Flemish and Walloon regions. Thanks a lot!


Solution

  • may be you can try this code:

    library(rnaturalearth)
    library(rnaturalearthdata)
    library(dplyr)
    spdf_Belgium <- ne_countries(country = 'Belgium',scale = "large")
    plot(spdf_Belgium)
    sf_world <- ne_countries(scale = "large", type = "countries", returnclass ="sf")
    plot(sf_world %>% filter(sovereignt == "Belgium") %>% dplyr::select(sovereignt, geometry))
    

    it seems that the two maps display a complete Belgian boundary. the packages rnaturalearth and rnaturalearthdata are all version 0.1.0