sf (version 0.3-4)

aggregate.sf: aggregate an

Description

aggregate an sf object, possibly union-ing geometries

Usage

# S3 method for sf
aggregate(x, by, FUN, ..., union = FALSE)

Arguments

x
object of class sf
by
integer or factor, the same length as the number of rows in x, with groups to aggregate by (aggregation predicate)
FUN
function passed on to aggregate, in case ids was specified and attributes need to be grouped
...
arguments passed on to FUN
union
logical; should grouped geometries be unioned using st_union?

Value

an sf object with aggregated attributes and geometries, with an additional grouping variable called Group.1.