How to remove and change bubbles on tm_bubbles

I created a map that has only has a value of 1 in the column "labour". The issue I am getting is that the legend shows up as in 0.2 scale (image below).

Rplot11

this is the code I used

library(tmap)
tmap_mode("plot")
v11<-tm_shape(settingmap)+
  tm_polygons("Construction", palette= "Reds",
              colorNA="white",
              showNA=FALSE)+
  tm_shape(settingmap)+
  tm_bubbles(size="Labour",col="blue")+
  tm_shape(settingmap)+
  tm_bubbles(size="Capital",col="yellow")+
  tm_shape(worldmap2) +
  tm_borders(col = "grey",lwd = 0.5)+
  tm_layout(bg.color = "white")+
  tm_layout(frame = TRUE,outer.margins=c(.05,0,.05,0), inner.margins=c(0,0,.02,0), asp=0,
            legend.outside=TRUE,
            legend.position=c("right","bottom"),
            title.position = c('right','top'))
#            legend.stack = "horizontal")
v11

I replaced the tm_bubble of labour in hopes to get what I wanted but I got an error:

  tm_bubbles(size="Capital",col="yellow",
             style="fixed",
             breaks=c(1),
             labels(1))
Error: symbol shape(s) ('shape' argument) is/are neither numeric nor valid variable name(s)

How can I achieve only one bubble that shows up in the legend but as the smallest size in the range but with 1 ?
something like this:

Rplot11_LI

Try to change style to style = "cont" and see if that will work. It also allows the entering of breaks and may help with it being a whole number. https://www.r-bloggers.com/map-coloring-the-color-scale-styles-available-in-the-tmap-package/
If not, what does trying adding legend.format() and using the parameters you need?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.