I have a set of polygons and I want to find the bbox for each polygon using sf.
st_bbox I obtain the bbox for the whole set of features but I want to obtain bbox for each feature.
I try to use
group_by() but the output is always the same.
library(sf) g <- st_sfc(st_point(1:2), st_point(3:4)) %>% st_buffer(dist = 1) s <- st_sf(a=3:4, g) s %>% group_by(a) %>% st_bbox()%>% st_as_sfc