Learn R Programming

stlnpp (version 0.4.0)

as.stlpp: Convert data to a spatio-temporal point pattern on a linear network

Description

This function converts data to a spatio-temporal point pattern on a linear network.

Usage

as.stlpp(x,y,t,L)

Value

A spatio-temporal point pattern on a linear network. An object of class stlpp.

Arguments

x, y, t

vectors of Cartesian coordinates and time occurrence. Alternatively, x can be of classes data.frame, ppp and lpp

L

linear network (object of class linnet)

Author

Mehdi Moradi <m2.moradi@yahoo.com>

Details

This function converts data to an object of class stlpp. Data can be of formats:

  • x is of class class data.frame with three columns. Then columns are considered as Cartesian coordinates (i.e. x,y,t) and they will be converted to a spatio-temporal point pattern on the linear network L.

  • x is a planar point pattern (class ppp). Then x will be converted to a spatio-temporal point pattern on the linear network L and with coresponding time vector t.

  • x is a linear point pattern (class lpp). Then x will be converted to a spatio-temporal point pattern on the linear network L and with coresponding time vector t.

  • x,y,t are vectors of same length where x,y are living on the corresponding network L.

See Also

stlpp

Examples

Run this code
 
data(easynet)
x <- runifpointOnLines(40, easynet)
t1 <- sample(1:10,40,replace=TRUE)
Y <- as.stlpp(x,t=t1,L=easynet)

Z <- as.lpp.stlpp(Y)
t2 <- sample(1:10,40,replace=TRUE)
W <- as.stlpp(Z,t=t2)

Run the code above in your browser using DataLab