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

> ### Name: collin
> ### Title: Estimates the Collinearity of Parameter Sets
> ### Aliases: collin plot.collin print.collin
> ### Keywords: utilities
> 
> ### ** Examples
> 
> ## =======================================================================
> ## Test collinearity values
> ## =======================================================================
> 
> ## linearly related set...  => Infinity
> collin(cbind(1:5, 2*(1:5)))
  X1 X2 N collinearity
1  1  1 2          Inf
> 
> ## unrelated set            => 1
> MM <- matrix(nr = 4, nc = 2, byrow = TRUE,
+   data = c(-0.400, -0.374, 0.255, 0.797, 0.690, -0.472, -0.546,  0.049))
> 
> collin(MM)
  X1 X2 N collinearity
1  1  1 2            1
> 
> ## =======================================================================
> ## Bacterial model as in Soetaert and Herman, 2009
> ## =======================================================================
> 
> pars <- list(gmax = 0.5,eff = 0.5,
+              ks = 0.5, rB = 0.01, dB = 0.01)
> 
> solveBact <- function(pars) {
+   derivs <- function(t, state, pars) {   # returns rate of change
+     with (as.list(c(state, pars)), {
+       dBact <-  gmax*eff*Sub/(Sub + ks)*Bact - dB*Bact - rB*Bact
+       dSub  <- -gmax    *Sub/(Sub + ks)*Bact + dB*Bact
+       return(list(c(dBact, dSub)))
+     })
+   }
+   state   <- c(Bact = 0.1, Sub = 100)
+   tout    <- seq(0, 50, by = 0.5)
+   ## ode solves the model by integration...
+   return(as.data.frame(ode(y = state, times = tout, func = derivs,
+     parms = pars)))
+ }
> 
> out <- solveBact(pars)
> 
> ## We wish to estimate parameters gmax and eff by fitting the model to
> ## these data:
> Data <- matrix(nc = 2, byrow = TRUE, data =
+   c(  2,  0.14,  4,  0.2,    6,  0.38,  8,  0.42,
+      10,  0.6,  12,  0.107, 14,  1.3,  16,  2.0,
+      18,  3.0,  20,  4.5,   22,  6.15, 24,  11,
+      26, 13.8,  28, 20.0,   30,  31 ,  35, 65, 40, 61)
+ )
> colnames(Data) <- c("time","Bact")
> head(Data)
     time  Bact
[1,]    2 0.140
[2,]    4 0.200
[3,]    6 0.380
[4,]    8 0.420
[5,]   10 0.600
[6,]   12 0.107
> 
> Data2 <- matrix(c(2, 100, 20, 93, 30, 55, 50, 0), ncol = 2, byrow = TRUE)
> colnames(Data2) <- c("time", "Sub")
> 
> 
> ## Objective function to minimise
> Objective <- function (x) {                  # Model cost
+  pars[] <- x
+  out   <- solveBact(x)
+  Cost  <- modCost(obs = Data2, model = out)  # observed data in 2 data.frames
+  return(modCost(obs = Data, model = out, cost = Cost))
+ }
> 
> ## 1. Estimate sensitivity functions - all parameters
> sF <- sensFun(func = Objective, parms = pars, varscale = 1)
Error in xy.coords(x, y, setLab = FALSE) : 
  'list' object cannot be coerced to type 'double'
Calls: sensFun ... modCost -> approx -> regularize.values -> xy.coords
Execution halted