I am trying to visualize percentage of anaemia patients using a map and successfully done it. The problem I am facing I can not remove the missing value category from the legend of the map. In my dataset, there is no missing value as I omitted those during the data processing part. I have used sf package to read the shape file and tmap package for visualizing map. I have attached my codes and map in this question.
map = data_joined_with_shape_file %>%
select(NAME_2, Anaemia, geometry) %>%
tm_shape()+
tm_polygons("Anaemia", breaks = c(0, 25, 30, 40, 50, 60),
palette = c("white","#f7fbff", "#9ecae1", "#6baed6", "#4292c6", "#08519c"))
Overall = map +
tm_shape(data_joined_with_shape_file %>% filter(Anaemia > 20))+
tm_text("NAME_2", size = 0.95,
fontfamily = "serif", just = "center", fontface = "bold")+
tm_layout(legend.position = c("right", "top"),
frame = FALSE, # Remove map frame
legend.text.size = 1.3, # Reduce legend text size
legend.title.size = 2, # Reduce legend title size
legend.bg.color = NA, # Remove legend background
legend.bg.alpha = 0, # Ensure transparency
legend.na.show = FALSE,
legend.title.fontface = "bold",
legend.text.fontfamily = "serif",
legend.title.fontfamily = "serif",
legend.frame = FALSE) # Remove legend frame
[](.png)
I want to remove the Missing label from the legend of this map.