| endpoints.psp {spatstat} | R Documentation |
Extracts the endpoints of each line segment in a line segment pattern.
endpoints.psp(x, which="both")
x |
A line segment pattern (object of class "psp").
|
which |
String specifying which endpoint or endpoints should be returned. See 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:
which="both"x.
which="first"x$ends$x0, x$ends$y0).
which="second"x$ends$x1, x$ends$y1).
which="left"which="right"which="lower"which="upper"
The result is a point pattern. It also has an attribute
"id" which is an integer vector identifying
the segment which contributed each point.
Point pattern (object of class "ppp").
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
psp.object,
ppp.object,
midpoints.psp
a <- psp(runif(10), runif(10), runif(10), runif(10), window=owin()) plot(a) b <- endpoints.psp(a, "left") plot(b, add=TRUE)