```r
cast_all = function(xg) {
  lapply(c("MULTIPOLYGON", "MULTILINESTRING", "MULTIPOINT", "POLYGON", "LINESTRING", "POINT"), 
         function(x) st_cast(xg, x))
}
t = cast_all(multipoint)
#> Warning in st_cast.MULTIPOINT(xg, x): point from first coordinate only
t2 = cast_all(polyg)
#> Warning in st_cast.POLYGON(xg, x): point from first coordinate only
```