1

I would like to create a dot map in R.

I have a shapefile called shp:

And a csv file called sch

and a water shapefile called water_shp

I gave that code

map <- inner_join(sch,shp,by="Region")
map = st_as_sf(map)


tm_shape(map) +
  tm_borders("grey", lwd = 1.25)  +
  tm_fill("ratio",style = "cont", legend.reverse = TRUE, title = "fertility ratio") 

But I can not add dot points in the map, which show the size of SEP? How can I do that?

1 Answer 1

3

Using nc sample data:

library(tmap)
library(sf)
example(st_read)

I think what you are trying to do is fill according to one attribute and then scale a dot based on another attribute. Use tm_bubbles for the dots:

tm_shape(nc) + tm_fill("NWBIR74") +  tm_bubbles(size="SID79")

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.