R/prepare.R

Defines functions prepare

Documented in prepare

prepare <- function (x = data.frame, ntime = 1, cols = c(2:(length(x[1, 
    ])))) 
{
    time <- x[, ntime]
    n <- length(time)
    yobs <- NULL
    for (i in cols) {
        yobs <- rbind(yobs, cbind(time, matrix(x[, i]), rep(i - 
            1, n)))
    }
    yobs <- as.data.frame(yobs)
    names(yobs) <- c("t", "y", "traj")
    yobs$traj <- as.factor(yobs$traj)
    yobs
}

Try the nlsrk package in your browser

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

nlsrk documentation built on June 24, 2017, 1:02 a.m.