st_multi: Aggregate geometries

Description Usage Arguments Value See Also Examples

View source: R/make.R

Description

Returns the geometry as a MULTI* geometry. If the geometry is already a MULTI*, it is returned unchanged.

Usage

1
st_multi(.geom, ...)

Arguments

.geom

A geometry or a set of geometries of class sfc to be grouped. The geometries are often aggregated using a dplyr::group_by() followed by a dplyr::summarise().

...

Unused.

Value

a single MULTI* geometry.

See Also

Other make: st_makeline, st_makepoint, st_numpoints

Examples

1
2
3
4
5
6
library(tibble)
library(dplyr)

tibble(g = c("a", "a"), point = c(st_point(12, 21), st_point(21, 12))) %>%
  group_by(g) %>%
  summarise(multi = st_multi(point))

etiennebr/geotidy documentation built on Feb. 28, 2020, 4:45 a.m.