I create two buffer around points and want to intersect the two buffers by id (creating a doughnut) around each point. With st_intersection I can only manage to get all possible intersections, resulting in many more new polygons than I have points.
library(sf)
library(sp)
library(dplyr)
data <- data.frame(id = paste0("ID_", 1:20), lon = runif(20, -10, 10), lat = runif(20, -10, 10))
data_sf <- st_as_sf(data,coords = c("lon", "lat"), crs = 4326) %>% st_transform(CRS("+proj=laea"))
bfr1 <- data_sf %>% st_buffer(150000)
bfr2 <- data_sf %>% st_buffer(450000)
inters1 <- st_intersection(bfr1, bfr2)
### I tried (with error)
bfr <- rbind(bfr1, bfr2)
hh <- bfr %>%
group_by(id) %>%
summarise(geometry = st_intersection(geometry)) %>%
ungroup()