Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

joinVertices

Join Vertices in a Network


Description

Join the specified vertices in a linear network, creating a new network.

Usage

joinVertices(L, from, to, marks=NULL)

Arguments

L

A linear network (object of class "linnet") or point pattern on a linear network (object of class "lpp").

from,to

Integers, or integer vectors of equal length, specifying the vertices which should be joined. Alternatively from can be a 2-column matrix of integers and to is missing or NULL.

marks

Optional vector or data frame of values associated with the new edges.

Details

Vertices of the network are numbered by their order of appearance in the point pattern vertices(L).

If from and to are single integers, then the pair of vertices numbered from and to will be joined to make a new segment of the network. If from and to are vectors of integers, then vertex from[i] will be joined to vertex to[i] for each i = 1,2,...

If L is a network (class "linnet"), the result is another network, created by adding new segments. If L is a point pattern on a network (class "lpp"), the result is another point pattern object, created by adding new segments to the underlying network, and retaining the points.

In the resulting object, the new line segments are appended to the existing list of line segments.

Value

A linear network (object of class "linnet") or point pattern on a linear network (object of class "lpp").

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

snet <- joinVertices(simplenet, 4, 8)
  plot(solist(simplenet, snet), main="")
  X <- runiflpp(3, simplenet)
  Y <- joinVertices(X, 4, 8)

spatstat.linnet

Linear Networks Functionality of the 'spatstat' Family

v2.1-1
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Ottmar Cronie [ctb], Tilman Davies [ctb], Greg McSwiggan [ctb], Suman Rakshit [ctb]
Initial release
2021-03-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.