as.lpp(x, y=NULL, seg=NULL, tp=NULL, ...,
marks=NULL, L=NULL, check=FALSE, sparse)
xy.coords
.
Alternatively x
can be a point pattern
on a linear network (object of class "lpp"
)
x,y
. See Details."linnet"
)
on which the points lie.linnet
."lpp"
)."lpp"
).
The possible formats are:
x
is already a point pattern on a linear network
(object of class"lpp"
).
Thenx
is returned unchanged.x
is a planar point pattern (object of class"ppp"
).
Thenx
is converted to a point pattern on the linear networkL
usinglpp
.x,y,seg,tp
are vectors of equal length.
These specify that thei
th point has Cartesian coordinates(x[i],y[i])
, and lies on segment numberseg[i]
of the
networkL
, at a fractional positiontp[i]
along that
segment (withtp=0
representing one endpoint andtp=1
the other endpoint of the segment).seg,tp
areNULL
, andx,y
are data in a format
acceptable toxy.coords
specifying the
Cartesian coordinates.lpp
.A <- as.psp(simplenet)
X <- runifpointOnLines(10, A)
is.ppp(X)
Y <- as.lpp(X, L=simplenet)
Run the code above in your browser using DataLab