| as.lpp {spatstat.linnet} | R Documentation |
Convert Data to a Point Pattern on a Linear Network
Description
Convert various kinds of data to a point pattern on a linear network.
Usage
as.lpp(x=NULL, y=NULL, seg=NULL, tp=NULL, ...,
marks=NULL, L=NULL, check=FALSE, sparse)
Arguments
x, y |
Vectors of cartesian coordinates, or any data
acceptable to |
seg, tp |
Optional local coordinates. Vectors of the same length
as |
... |
Ignored. |
marks |
Optional marks for the point pattern. A vector or factor with one entry for each point, or a data frame or hyperframe with one row for each point. |
L |
Linear network (object of class |
check |
Logical. Whether to check the validity of the spatial coordinates. |
sparse |
Optional logical value indicating whether to store the
linear network data in a sparse matrix representation or not.
See |
Details
This function converts data in various formats into a point pattern
on a linear network (object of class "lpp").
The possible formats are:
-
xis already a point pattern on a linear network (object of class"lpp"). Thenxis returned unchanged. -
xis a planar point pattern (object of class"ppp"). Thenxis converted to a point pattern on the linear networkLusinglpp. -
x,y,seg,tpare vectors of equal length. These specify that theith 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=0representing one endpoint andtp=1the other endpoint of the segment). -
x,yare missing andseg,tpare vectors of equal length as described above. -
seg,tpareNULL, andx,yare data in a format acceptable toxy.coordsspecifying the Cartesian coordinates. -
Only the arguments
xandLare given, andxis a data frame with one of the following types:two columns labelled
seg,tpinterpreted as local coordinates on the network.two columns labelled
x,yinterpreted as Cartesian coordinates.four columns labelled
x,y,seg,tpinterpreted as Cartesian coordinates and local coordinates.
Value
A point pattern
on a linear network (object of class "lpp").
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
and Rolf Turner rolfturner@posteo.net
See Also
lpp.
Examples
A <- as.psp(simplenet)
X <- runifpointOnLines(10, A)
is.ppp(X)
Y <- as.lpp(X, L=simplenet)