1

I have created 2 buffers of 250m and 500m. When I plot my data, it shows my legend as having too many Summarising population in buffers

I want the legend to have 0-250, 250-500, then over 500, and missing data

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

1

I am not sure I understand the question since you are not providing a reproducible example, but I think the following would help:

Use the breaks and labels aruments in the tm_polygons() function.

nc = st_read(system.file("shape/nc.shp", package="sf"))

Breaks <- c(0, 2000, 4000, 6000, 31000)
Labels <- c("0 - 2000", "2000 - 4000", "4000 - 6000", ">6000")
MyPalette <- c("#f2f0f7", "#cbc9e2", "#9e9ac8", "#6a51a3")

tm_shape(nc) + 
  tm_polygons(col="BIR79", title = "Births 1979 - 84", palette = "YlGnBu",
          breaks = Breaks, labels = Labels)

tm_shape(nc) + 
  tm_polygons(col="BIR79", title = "Births 1979 - 84", palette = MyPalette,
          breaks = Breaks, labels = Labels)
Orlando Sabogal
  • 1,470
  • 7
  • 20