connected.lpp | R Documentation |
Finds the topologically-connected components of a point pattern on a linear network, when all pairs of points closer than a threshold distance are joined.
## S3 method for class 'lpp'
connected(X, R=Inf, ..., dismantle=TRUE)
X |
A linear network (object of class |
R |
Threshold distance. Pairs of points will be joined together
if they are closer than |
dismantle |
Logical. If |
... |
Ignored. |
The function connected
is generic. This is the method for
point patterns on a linear network (objects of class "lpp"
).
It divides the point pattern X
into one or more groups of points.
If R=Inf
(the default), then X
is divided into groups
such that any pair of points in the same group
can be joined by a path in the network.
If R
is a finite number, then two points of X
are
declared to be R-close if they lie closer than
R
units apart, measured by the length of the shortest path in the
network. Two points are R-connected if they
can be reached by a series of steps between R-close pairs of
points of X
. Then X
is divided into groups such that
any pair of points in the same group is R-connected.
If dismantle=TRUE
(the default) the algorithm first checks
whether the network is connected (i.e. whether any pair of vertices
can be joined by a path in the network), and if not, the network is
decomposed into its connected components.
A point pattern (of class "lpp"
) with marks indicating the
grouping, or a list of such point patterns.
.
thinNetwork
## behaviour like connected.ppp
U <- runiflpp(20, simplenet)
plot(connected(U, 0.15, dismantle=FALSE))
## behaviour like connected.owin
## remove some edges from a network to make it disconnected
plot(simplenet, col="grey", main="", lty=2)
A <- thinNetwork(simplenet, retainedges=-c(3,5))
plot(A, add=TRUE, lwd=2)
X <- runiflpp(10, A)
## find the connected components
cX <- connected(X)
plot(cX[[1]], add=TRUE, col="blue", lwd=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.