R/typeII2typeI.r

Defines functions typeII2typeI

Documented in typeII2typeI

typeII2typeI <- function(x)
{
    if (!inherits(x, "ltraj"))
        stop("x should be of class \"ltraj\"")
    if (!attr(x, "typeII"))
        stop("x should be of type II (time recorded)")
    res <- lapply(x, function(i) {i$date <- 1:nrow(i);return(i)})
    class(res) <- c("ltraj","list")
    attr(res, "typeII") <- FALSE
    attr(res, "regular") <- FALSE
    attr(res, "proj4string") <- .checkp4(x)

    res <- rec(res)
    return(res)
}
ClementCalenge/adehabitatLT documentation built on April 16, 2023, 10:20 a.m.