Hi,

I am having similar problem despite tryng the "attach" and other techniques previously described to match the variable types. I am trying to run the mathematical model but get the similar error message when plotting:

> require(FME)

> CSIfluc<-function(t, y, pars) {

+ with (as.list(c(y, pars)),{

+ N<-S+C+I

+ dS <- a*(1-N) - f*S*V - m*S - d*S

+ dC <- f*S*V + g*I + r*(1-N) - b2*C - m*C - d*C - b1*V*I

+ dI <- b2*C + b1*V*I - g*I - u*I

+ dV <- o*(C+I) - V*e

+ list(c(dS, dC, dI, dV),N)

+ })

+ }

> # parameter values

> pars <- list(a=0.2, m=0.0001, u=0.00003, b1=0.00023, b2=0.007, f=0.006, g=0.2, r=0.343, o=10.2, e=78, d=0.029)

> # initial conditions

> y = c(S=0.99,C=0.01,I=0,V=1)

> t <-seq(0,365, by=30)

> out1 <- as.data.frame(rk(y, t, CSIfluc, pars, method = "rk45dp7"))

> fluc1 <- stode(y = y, time=t, func = CSIfluc, parms = pars, pos = TRUE)

> fluc2 <- runsteady(y = y, func = CSIfluc, parms = pars, times = c(0, 1000))

> R0<-1/fluc1$S

> R02<-1/fluc2$S

> Re <- (1/fluc1$S * out1$S)

> Re2<- (1/fluc2$S * out1$S)

> mf <- par(mfrow = c(2,2))

> plot (fluc1$t, R0, type = "l", xlab = "Time (Days)", ylab = "R0")

Error in plot.window(...) : need finite 'xlim' values

In addition: Warning messages:

1: In min(x) : no non-missing arguments to min; returning Inf

2: In max(x) : no non-missing arguments to max; returning -Inf

3: In min(x) : no non-missing arguments to min; returning Inf

4: In max(x) : no non-missing arguments to max; returning -Inf

> plot (fluc2$t, R02, type = "l", xlab = "Time (Days)", ylab = "R0")

Error in plot.window(...) : need finite 'xlim' values

In addition: Warning messages:

1: In min(x) : no non-missing arguments to min; returning Inf

2: In max(x) : no non-missing arguments to max; returning -Inf

3: In min(x) : no non-missing arguments to min; returning Inf

4: In max(x) : no non-missing arguments to max; returning -Inf

> plot (fluc1$t, Re, type = "l", xlab = "Time (Days)", ylab = "Re")

Error in plot.window(...) : need finite 'xlim' values

In addition: Warning messages:

1: In min(x) : no non-missing arguments to min; returning Inf

2: In max(x) : no non-missing arguments to max; returning -Inf

3: In min(x) : no non-missing arguments to min; returning Inf

4: In max(x) : no non-missing arguments to max; returning -Inf

> plot (fluc2$t, Re2, type = "l", xlab = "Time (Days)", ylab = "Re")

Error in plot.window(...) : need finite 'xlim' values

In addition: Warning messages:

1: In min(x) : no non-missing arguments to min; returning Inf

2: In max(x) : no non-missing arguments to max; returning -Inf

3: In min(x) : no non-missing arguments to min; returning Inf

4: In max(x) : no non-missing arguments to max; returning -Inf

Any suggestions would be appreciated? Thank you.

Anil Panackal, M.D., Sc.M., FACP