I am trying to create faceted maps with the "tmap" package. My data contains a lot of missing countries. When I run the code below, the output shows a lot of missing countries. How can get the plot to show missing countries?
library(tmap)
world<-data("World")
MAP<- read_excel("SSPMAP.xlsx")
MAP2<-MAP %>% group_by(iso_a3,scenario ) %>%
summarise(cibase=median(gr_C_2030)*100)
table(MAP2$cibase)
cut<-c(-4,-2,0,2,4,6,8)
World_n<-left_join(World, MAP2, by="iso_a3")
###########################
Base<-tm_shape(World_n, projection = "eck4") +
tm_polygons("cibase", breaks = cut,
palette = "RdYlGn",
border.col = "black",
border.alpha = 1,midpoint = NA ) +
tm_legend(legend.position = c("left", "bottom")) +
tm_facets(by=c("scenario"), ncol =1, showNA = FALSE)+
tm_layout(panel.labels=c("Baseline : SSP1","Baseline : SSP2","Baseline : SSP4","Baseline : SSP5"),panel.label.color = "black"
,panel.label.size=1.3,panel.label.fontface="bold")
Base
tmap_save(Base,"Base.png")