Learn R Programming

spatstat.linnet (version 3.4-1)

threads: Identify Uninterrupted Threads in a Linear Network

Description

Given a linear network, find the threads. A thread is a set of connected edges which do not pass through any forks in the network.

Usage

threads(X, what = c("tessellation", "labels"))

Value

A factor, or a tessellation on the network (object of class "lintess").

Arguments

X

A linear network (object of class "linnet").

what

String (partially matched) specifying the kind of result.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

Details

A ‘thread’ in a network is a subset of the edges of the network which does not pass through any forks in the network.

Given a linear network X, this function identifies the threads in X and assigns a label to each edge (segment) of the network indicating which thread it belongs to.

Formally a thread is a set of edges joining successive vertices \(v_1, \ldots, v_n\) of the network such that

  • there is an edge of the network joining \(v_i\) and \(v_{i+1}\) for each \(i\)

  • each of the intermediate vertices vertices \(v_2, \ldots, v_{n-1}\) has degree 2 (i.e. there are exactly 2 edges of the network which end at the vertex)

  • the terminal vertices \(v_1\) and \(v_n\) do not have degree 2, unless they are the same vertex.

Every edge (segment) of the network belomgs to a unique thread. This algorithm assigns a label to each edge indicating which thread it belongs to. If what="labels" (the default), the result is a factor of length equal to nsegments(X) giving the classification of segments. If what="tessellation", the result is a tessellation of X (object of class "lintess") in which the tiles of the tessellation are the threads.

See Also

connected.linnet

Examples

Run this code
  A <- edges(letterR)
  B <- edges(disc(npoly=16, centre=centroid.owin(letterR)))
  L <- as.linnet(superimpose(A,B))
  plot(threads(L),
       col=rainbow, scramble.cols=TRUE,
       lwd=2, show.window=FALSE)

Run the code above in your browser using DataLab