spatialEco (version 1.3-2)

explode: Explodes multipart features

Description

Explodes multipart features into single part

Usage

explode(x, sp = FALSE)

Arguments

x

sp or sf multipart (MULTIPOLYGON, MULTIPOINT, MULTILINE) object

sp

(FALSE/TRUE) output as sp class object, else is sf class

Value

A single part sp or sf object (polygons or points)

Examples

Run this code
# NOT RUN {
library(sf)
library(sp)

dim( p.sf <- st_read(system.file("shapes/sids.shp", package = "spData")[1]) )
dim( p.sf <- explode(p.sf) )
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace