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
    return(res)
}

Try the adehabitat package in your browser

Any scripts or data that you put into this service are public.

adehabitat documentation built on Jan. 28, 2018, 5:02 p.m.