distbdry.lpp: Distance To Boundary in a Linear Network

View source: R/nndistlpp.R

distbdry.lppR Documentation

Distance To Boundary in a Linear Network

Description

For a point pattern on a linear network, compute the distance from each point to the nearest terminal vertex of the network.

Usage

## S3 method for class 'lpp'
distbdry(X)

Arguments

X

A point pattern on a linear network (class "lpp").

Details

This function computes the distance from each data point X[i] to the nearest terminal vertex of the network. A terminal vertex is a vertex which is the endpoint of exactly one segment of the network. Distance is measured by the length of the shortest path in the network.

The function distbdry is generic, with methods for class "ppp", "pp3", "lpp" and other classes.

Value

A numeric vector with one entry for each point of X.

Author(s)

\spatstatAuthors

.

See Also

distbdry

Examples

  X <- if(interactive()) chicago else spiders
  b <- distbdry(X)
  plot(X %mark% b, main=expression(distbdry(X)),
       pch=16, size=1, cols=topo.colors(128))
  L <- domain(X)
  V <- vertices(L)
  d <- vertexdegree(L)
  Terminal <- V[d == 1]
  points(Terminal, pch=2, col="red")

spatstat.linnet documentation built on July 30, 2026, 5:10 p.m.