Learn R Programming

spatstat (version 1.23-1)

endpoints.psp: Endpoints of Line Segment Pattern

Description

Extracts the endpoints of each line segment in a line segment pattern.

Usage

endpoints.psp(x, which="both")

Arguments

x
A line segment pattern (object of class "psp").
which
String specifying which endpoint or endpoints should be returned. See Details.

Value

  • Point pattern (object of class "ppp").

Details

This function extracts one endpoint, or both endpoints, from each of the line segments in x, and returns these points as a point pattern object. The argument which determines which endpoint or endpoints of each line segment should be returned: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] The result is a point pattern. It also has an attribute "id" which is an integer vector identifying the segment which contributed each point.

See Also

psp.object, ppp.object, midpoints.psp

Examples

Run this code
a <- psp(runif(10), runif(10), runif(10), runif(10), window=owin())
  plot(a)
  b <- endpoints.psp(a, "left")
  plot(b, add=TRUE)

Run the code above in your browser using DataLab