Adds new vertices to a linear network at specified locations along the network.
Linear network (object of class
Additional arguments passed to
This function adds new vertices at locations along an existing linear network.
L can be either a linear network (class
"linnet") or some other object that includes a linear network.
The new vertex locations can be specified either as a
point pattern (class
or using coordinate vectors
x,y,seg,tp as explained in the help for
This function breaks the existing line segments
L into pieces at the locations specified by
seg,tp and creates new vertices at these
The result is the modified object, with an attribute
"id" such that
ith added vertex has become the
id[i]th vertex of the new network.
An object of the same class as
L representing the result of
adding the new vertices.
The result also has an attribute
"id" as described in Details.
addVertices to create new vertices at locations which
are not yet on the network.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
opa <- par(mfrow=c(1,3), mar=rep(0,4)) simplenet plot(simplenet, main="") plot(vertices(simplenet), add=TRUE) # add two new vertices at specified local coordinates L <- insertVertices(simplenet, seg=c(3,7), tp=c(0.2, 0.5)) L plot(L, main="") plot(vertices(L), add=TRUE) id <- attr(L, "id") id plot(vertices(L)[id], add=TRUE, pch=16) # add new vertices at three randomly-generated points X <- runiflpp(3, simplenet) LL <- insertVertices(simplenet, X) plot(LL, main="") plot(vertices(LL), add=TRUE) ii <- attr(LL, "id") plot(vertices(LL)[ii], add=TRUE, pch=16) par(opa)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.