R/plot.nlsrk.R

plot.nlsrk = function (x, data, maintitle = "Ordinary Differential Equations system", 
    ...) 
{
    if (!is.data.frame(data)) 
        stop("*** ERROR : data.frame expected ***\n")
    if (!all(names(data) == c("t", "y", "traj"))) 
        stop("*** ERROR : names t,y,traj expected ***\n")
    if (class(x) != "nls") 
        stop("*** ERROR : x of class 'nls' expected ***\n")
    plot(data$t, data$y, pch = 19 + as.numeric(data$traj))
    u <- cbind(data$t, fitted.values(x))
    p <- max(as.numeric(data$traj))
    for (i in 1:p) lines(u[data$traj == i, ], col = i)
}

Try the nlsrk package in your browser

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

nlsrk documentation built on May 1, 2019, 8:48 p.m.