R/mefaNestedless.R

Defines functions `mefaNestedless`

`mefaNestedless` <-
function(x)
{
    inherits(x, "mefa") || stop("'x' must be of class 'mefa'")
    if (is.null(x$segm))
        stop("no segments in 'x'")
    out <- x$segm
    n <- length(out)
    nam <- nam2 <- names(out)
    for (i in 1:(nchar(nam2[1]) + 1))
        substr(nam2[-1], 1, nchar(nam2[1]) + 1) <- ""
    names(out) <- nam2
    for (i in 2:n) {
        out[[i]] <- out[[i]] - x$segm[[(i-1)]]
    }
    x$segm <- out
    x$call <- match.call()
    attr(x, "nested") <- FALSE
    return(x)
}

Try the mefa package in your browser

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

mefa documentation built on May 2, 2019, 5 p.m.