Learn R Programming

terra (version 1.2-10)

convHull: Convex hull

Description

Get the convex hull of a vector dataset

Usage

# S4 method for SpatVector
convHull(x, by="")

Arguments

x

SpatVector

by

character (variable name), to make convex hulls by group

Value

SpatVector

Examples

Run this code
# NOT RUN {
p <- vect(system.file("ex/lux.shp", package="terra"))
h <- convHull(p)

hh <- convHull(p, "NAME_1")
plot(hh, "NAME_1", col=rainbow(10, alpha=.5), lwd=3)
lines(aggregate(p, "NAME_1"), col="blue", lty=2, lwd=2)
# }

Run the code above in your browser using DataLab