convexhull.xy: Convex Hull of Points

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ripras.R

Description

Computes the convex hull of a set of points in two dimensions.

Usage

1

Arguments

x

vector of x coordinates of observed points, or a 2-column matrix giving x,y coordinates, or a list with components x,y giving coordinates (such as a point pattern object of class "ppp".)

y

(optional) vector of y coordinates of observed points, if x is a vector.

Details

Given an observed pattern of points with coordinates given by x and y, this function computes the convex hull of the points, and returns it as a window.

Value

A window (an object of class "owin").

Author(s)

\adrian

and \rolf

See Also

owin, as.owin, convexhull, bounding.box.xy, ripras

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  x <- runif(30)
  y <- runif(30)
  w <- convexhull.xy(x,y)
  plot(owin(), main="convexhull.xy(x,y)", lty=2)
  plot(w, add=TRUE)
  points(x,y)

  X <- runifrect(30)
  plot(X, main="convexhull.xy(X)")
  plot(convexhull.xy(X), add=TRUE)

spatstat.geom documentation built on April 15, 2021, 9:06 a.m.