Apply st_bbox() for each feature in sf
g0 <- st_sfc(st_point(1:2), st_point(3:4))
g1 <- st_buffer(g0, dist=1)
is.list(g1)
f <- function(x) st_as_sfc(st_bbox(x))
bbs <- do.call("c", lapply(g1, f))
bbs
plot(bbs)
plot(g1, add = T)
I take solution from here https://github.com/r-spatial/sf/issues/1179