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.