title: Create polygons representing bounding boxes for subgroups using sf
body: <p>I'm attempting to use the sf package and a piped/tidyverse workflow to generate bounding boxes based on groups defined in another column. I think it should work like below, but it seems like st_bbox is not respecting groups. </p>
  
  <p>I expect to receive three polygon records that represent bounding boxes around proints from a, b, and c, but instead I receive three polygon records that represent bounding boxes for all points.</p>
  
  <pre><code>library(dplyr)
  library(sf)
  
  a &lt;- data.frame(group=rep('a',100), lon=rnorm(100,11,.2), lat=rnorm(100,53,.2))
  b &lt;- data.frame(group=rep('b',100), lon=rnorm(100,11.5,.2), lat=rnorm(100,53.5,.2))
  c &lt;- data.frame(group=rep('c',100), lon=rnorm(100,12,.2), lat=rnorm(100,54,.2))
  dat &lt;- rbind(a,b,c)
  
  pts &lt;- dat %&gt;% st_as_sf(coords=c('lon','lat'),crs=4326) 
  
  pts %&gt;%
    group_by(group) %&gt;%
    summarize(geometry = st_as_sfc(st_bbox(geometry)))
  </code></pre>
  
  <p>This returns:</p>
  
  <pre><code>Simple feature collection with 3 features and 1 field
  geometry type:  POLYGON
  dimension:      XY
  bbox:           xmin: 10.34313 ymin: 52.43993 xmax: 12.54254 ymax: 54.54012
  epsg (SRID):    4326
  proj4string:    +proj=longlat +datum=WGS84 +no_defs
  # A tibble: 3 x 2
    group                                                                                     geometry
    &lt;fct&gt;                                                                                &lt;POLYGON [°]&gt;
  1 a     ((10.34313 52.43993, 12.54254 52.43993, 12.54254 54.54012, 10.34313 54.54012, 10.34313 52...
  2 b     ((10.34313 52.43993, 12.54254 52.43993, 12.54254 54.54012, 10.34313 54.54012, 10.34313 52...
  3 c     ((10.34313 52.43993, 12.54254 52.43993, 12.54254 54.54012, 10.34313 54.54012, 10.34313 52...
  </code></pre>