Learn R Programming

spatstat.linnet (version 3.5-3)

distbdry.lpp: 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 lpp
distbdry(X)

Value

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

Arguments

X

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

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.

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.

See Also

distbdry

Examples

Run this code
  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")

Run the code above in your browser using DataLab