Learn R Programming

trip (version 1.8.5)

as.trip: Coercion from other classes to trip objects

Description

Coercing objects to trip class

Usage

as.trip(x, ...)

Arguments

x,

ltr ltraj object

Arguments passed to other methods. Ignored for ltraj method.

Methods

coerce

signature(from="ltraj", to="trip")

as.trip

signature(x="ltraj")

Examples

Run this code
# NOT RUN {
 d <- data.frame(x=1:10, y=rnorm(10), tms=Sys.time() + 1:10, id=gl(2, 5))
sp::coordinates(d) <- ~x+y
## this avoids complaints later, but these are not real track data (!)
sp::proj4string(d) <- sp::CRS("+proj=laea +ellps=sphere", doCheckCRSArgs = FALSE)
tr <- trip(d, c("tms", "id"))

if (require(adehabitatLT)) {
    ##l <- as.ltraj.trip(tr)
    ##ltraj2trip(l)
    ##as.trip(l)
}
# }

Run the code above in your browser using DataLab