Running examples in ‘deSolve-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: ode.band
> ### Title: Solver for Ordinary Differential Equations; Assumes a Banded
> ###   Jacobian
> ### Aliases: ode.band
> ### Keywords: math
> 
> ### ** Examples
> 
> 
> ## =======================================================================
> ## The Aphid model from Soetaert and Herman, 2009.
> ## A practical guide to ecological modelling.
> ## Using R as a simulation platform. Springer.
> ## =======================================================================
> 
> ## 1-D diffusion model
> 
> ## ================
> ## Model equations
> ## ================
> Aphid <- function(t, APHIDS, parameters) {
+   deltax  <- c (0.5*delx, rep(delx, numboxes-1), 0.5*delx)
+   Flux    <- -D*diff(c(0, APHIDS, 0))/deltax
+   dAPHIDS <- -diff(Flux)/delx + APHIDS*r
+ 
+   list(dAPHIDS)   # the output
+ }
>   
> ## ==================
> ## Model application
> ## ==================
> 
> ## the model parameters:
> D         <- 0.3    # m2/day  diffusion rate
> r         <- 0.01   # /day    net growth rate
> delx      <- 1      # m       thickness of boxes
> numboxes  <- 60 
> 
> ## distance of boxes on plant, m, 1 m intervals
> Distance  <- seq(from = 0.5, by = delx, length.out = numboxes)
> 
> ## Initial conditions, ind/m2
> ## aphids present only on two central boxes
> APHIDS        <- rep(0, times = numboxes)
> APHIDS[30:31] <- 1
> state         <- c(APHIDS = APHIDS)      # initialise state variables 
>                   
> ## RUNNING the model:
> times <- seq(0, 200, by = 1)   # output wanted at these time intervals
> out   <- ode.band(state, times, Aphid, parms = 0, 
+                   nspec = 1, names = "Aphid")
> 
> ## ================
> ## Plotting output
> ## ================
> image(out, grid = Distance, method = "filled.contour", 
+       xlab = "time, days", ylab = "Distance on plant, m",
+       main = "Aphid density on a row of plants")
> 
> matplot.1D(out, grid = Distance, type = "l", 
+    subset = time %in% seq(0, 200, by = 10))
> 
> # add an observed dataset to 1-D plot (make sure to use correct name):
> data <- cbind(dist  = c(0,10, 20,  30,  40, 50, 60), 
+               Aphid = c(0,0.1,0.25,0.5,0.25,0.1,0))
> 
> matplot.1D(out, grid = Distance, type = "l", 
+    subset = time %in% seq(0, 200, by = 10), 
+    obs = data, obspar = list(pch = 18, cex = 2, col="red"))
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
deSolve
 --- call from context --- 
SetData(obs)
 --- call from argument --- 
if (!class(obs) %in% c("data.frame", "matrix")) stop("'obs' should be either a 'data.frame' or a 'matrix'")
 --- R stacktrace ---
where 1: SetData(obs)
where 2: matplot.1D(out, grid = Distance, type = "l", subset = time %in% 
    seq(0, 200, by = 10), obs = data, obspar = list(pch = 18, 
    cex = 2, col = "red"))

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (obs) 
{
    nobs <- 0
    obs.pos <- NULL
    obsname <- NULL
    if (!is.null(obs)) {
        if (!is.data.frame(obs) & is.list(obs)) {
            Obs <- obs
            obs <- Obs[[1]]
            obs.pos <- matrix(nrow = 1, c(1, nrow(obs)))
            if (!class(obs) %in% c("data.frame", "matrix")) 
                stop("'obs' should be either a 'data.frame' or a 'matrix'")
            if (length(Obs) > 1) 
                for (i in 2:length(Obs)) {
                  obs <- mergeObs(obs, Obs[[i]])
                  obs.pos <- rbind(obs.pos, c(obs.pos[nrow(obs.pos), 
                    2] + 1, nrow(obs)))
                }
            obsname <- colnames(obs)
        }
        else {
            if (is.character(obs[, 1]) | is.factor(obs[, 1])) 
                obs <- convert2wide(obs)
            obsname <- colnames(obs)
            if (!class(obs) %in% c("data.frame", "matrix")) 
                stop("'obs' should be either a 'data.frame' or a 'matrix'")
            obs.pos <- matrix(nrow = 1, c(1, nrow(obs)))
        }
        DD <- duplicated(obsname)
        if (sum(DD) > 0) 
            obs <- mergeObs(obs[, !DD], cbind(obs[, 1], obs[, 
                DD]))
        nobs <- nrow(obs.pos)
    }
    return(list(dat = obs, pos = obs.pos, name = obsname, length = nobs))
}
<bytecode: 0x55b48e583df8>
<environment: namespace:deSolve>
 --- function search by body ---
Function SetData in namespace deSolve has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1