st_combine by variables R
Using st_combine() by Variables in R
library(sf)
# Create a simple feature (sf) object
nc <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
# Combine geometries by a variable
nc_combined <- st_combine(nc["NAME"])
# Print the combined object
nc_combined
- Load the sf Package
library(sf)
- Create a Simple Feature (sf) Object
nc <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
- Combine Geometries by a Variable
nc_combined <- st_combine(nc["NAME"])
- Print the Combined Object
nc_combined