Rectangling data: applications

What we want wrt the geometry column:

  • for each element, only unnest all contents of bounds list
  • using custom column names
  • do it all in one step!!

So we need something similar to purrr::pluck(), but for unnesting.

locations$geometry[[1]] |> str()
## List of 4
##  $ bounds       :List of 2
##   ..$ northeast:List of 2
##   .. ..$ lat: num 30.1
##   .. ..$ lng: num -95
##   ..$ southwest:List of 2
##   .. ..$ lat: num 29.5
##   .. ..$ lng: num -95.8
##  $ location     :List of 2
##   ..$ lat: num 29.8
##   ..$ lng: num -95.4
##  $ location_type: chr "APPROXIMATE"
##  $ viewport     :List of 2
##   ..$ northeast:List of 2
##   .. ..$ lat: num 30.1
##   .. ..$ lng: num -95
##   ..$ southwest:List of 2
##   .. ..$ lat: num 29.5
##   .. ..$ lng: num -95.8