Learn R Programming

trip (version 1.1-21)

as.Other: As ("trip", other-classes)

Description

Coercing trip objects to other classes.

Function to create a SpatialLinesDataFrame from a trip object, resulting in a line segment for each implicit segment along the tracks. The object stores the start and end times, duration and the ID of the segment.

Usage

"as.ppp"(X, ..., fatal)
"as.psp"(x, ..., from, to)
explode(x, ...)

Arguments

X
trip object.
...
reserved for future methods
fatal
Logical value, see Details of as.ppp
x
trip object
from
see as.psp for that method.
to
See as.psp.

Value

ppp objectpsp objectSpatialLinesDataFrameSpatialLinesDataFrame object with each individual line segment identified by start/end time and trip ID

Examples

Run this code
## Not run: 
#   ## Continuing the example from '?trip-methods:
# utils::example("trip-methods", package="trip",
#            ask=FALSE, echo=FALSE)
#  as(tr, "ppp")
# ## End(Not run)
## Not run: 
#  ## Continuing the example from '?trip-methods:
# utils::example("trip-methods", package="trip",
#            ask=FALSE, echo=FALSE)
#  as.psp.trip(tr)
# ## End(Not run)
## Continuing the example from '?trip-methods:
utils::example("trip-methods", package="trip",
           ask=FALSE, echo=FALSE)
spldf <- explode(tr)
summary(tr)

Run the code above in your browser using DataLab