Home > OS >  tmap, ggplot and missing polygon (Barbados)
tmap, ggplot and missing polygon (Barbados)

Time:10-14

I am used to work with tmap plus ggplot with the dataset included in tmap: "World" but I just found out that it does not include Barbados for certain reason. I need the area and MULTIPOLYGON. I do not know how to get it from elsewhere.

CodePudding user response:

rnaturalearthhires package includes Barbados as a separate country. This may help.

library(rnaturalearthhires)
library(rnaturalearth)
library(tmap)


bb <- ne_countries(country = 'Barbados', scale = 10, returnclass = 'sf')


tm_shape(bb) 
  tm_polygons() 
  tm_layout(main.title = "Barbados")

Created on 2022-10-13 with reprex v2.0.2

  • Related