How can I divide the multiple overlapping polygons into multiple non-overlapping polygons? Here is an example: I would like to divide the long yellow polygon in the image into 3 polygons based on where it touches the other two.
library(spData)
library(sf)
seine_buff_5km = st_buffer(seine, dist = 5000)
tmap_mode("plot")
tm_shape(seine_buff_5km) +
tm_fill( col = "name", alpha =.5) +
tm_shape(seine) +
tm_lines()
Of course, I would like to do that for a larger data set with many more polygons. I guess one way to do it is subtract all polygons in an sf object from each other.