as.sfmultipolygon: Transform a sf object with several rows (polygons) by region...

View source: R/as.sfmultipolygon.R

as.sfmultipolygonR Documentation

Transform a sf object with several rows (polygons) by region to an sf object with one row by region and thus one multipolygon by region

Description

Transform a sf object with several rows (polygons) by region to an sf object with one row by region and thus one multipolygon by region

Usage

as.sfmultipolygon(data, idregion, closepolygon = FALSE)

Arguments

data

a sf object

idregion

a character string which indicates the name of the column (in data object) which contains the region identifier.

closepolygon

a boolean (default to FALSE) if TRUE it controls if polygons are closed and if not add the first vertice at the end.

Value

a sf object with one row by region and one multipolygon by region.


cartogramR documentation built on Sept. 11, 2024, 5:48 p.m.