I am trying to visulaise count data using tmap for the first time. Zero counts are informative and need to be displayed.
I have the following code:
Long<- c(149.942, 149.93583, 149.96217, 149.963, 149.96833,
149.97233)
Lat <- c(-36.919, -36.8345, -36.92367, -36.81117, -36.97183,
-36.96033)
count <- c(0, 0, 107, 0, 0, 20)
da<-data.frame(Long, Lat, count)
locations_sf3 <- st_as_sf(da, coords = c("Long", "Lat"))
ns<-locations_sf3
tm_shape(ns) +
tm_bubbles(col = "gold", size = "count")+
tm_legend(outside = TRUE)
However, tm_bubbles removes the zeros. I have coded this in ggplot and displayed zeros but wanted to move to the more elegant tmap. the ggplot code:
ggplot(aes(longitude, latitude, size = sum))+
annotation_map(map_data("world"))+
geom_point(col="red",pch=16)+
coord_quickmap()
Giving:
Any help to get this working in tmap would be greatly appreciated.