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

> ### Name: plot.deSolve
> ### Title: Plot, Image and Histogram Method for deSolve Objects
> ### Aliases: plot.deSolve plot.1D matplot.0D matplot.deSolve matplot.1D
> ###   hist.deSolve image.deSolve subset.deSolve
> ### Keywords: hplot
> 
> ### ** Examples
> 
> ## =======================================================================
> ## Example 1. A Predator-Prey model with 4 species in matrix formulation
> ## =======================================================================
> 
> LVmatrix <- function(t, n, parms) {
+   with(parms, {
+     dn <- r * n + n * (A %*% n)
+     return(list(c(dn)))
+   })
+ }
> parms <- list(
+   r = c(r1 = 0.1, r2 = 0.1, r3 = -0.1, r4 = -0.1),
+   A = matrix(c(0.0, 0.0, -0.2, 0.01,      # prey 1
+                0.0, 0.0, 0.02, -0.1,      # prey 2
+                0.2, 0.02, 0.0, 0.0,       # predator 1; prefers prey 1
+                0.01, 0.1, 0.0, 0.0),      # predator 2; prefers prey 2
+                nrow = 4, ncol = 4, byrow=TRUE)
+ )
> times <- seq(from = 0, to = 500, by = 0.1)
> y     <- c(prey1 = 1, prey2 = 1, pred1 = 2, pred2 = 2)
> 
> out <- ode(y, times, LVmatrix, parms)
> 
> ## Basic line plot
> plot(out, type = "l")
> 
> ## User-specified axis labels
> plot(out, type = "l", ylab = c("Prey 1", "Prey 2", "Pred 1", "Pred 2"),
+   xlab = "Time (d)", main = "Time Series")
> 
> ## Set user-defined mfrow
> pm <- par (mfrow = c(2, 2))
> 
> ## "mfrow=NULL" keeps user-defined mfrow
> plot(out, which = c("prey1", "pred2"), mfrow = NULL, type = "l", lwd = 2)
> 
> plot(out[,"prey1"], out[,"pred1"], xlab="prey1",
+   ylab = "pred1", type = "l", lwd = 2)
> plot(out[,"prey2"], out[,"pred2"], xlab = "prey2",
+   ylab = "pred2", type = "l",lwd = 2)
> 
> ## restore graphics parameters
> par ("mfrow" = pm)
> 
> ## Plot all in one figure, using matplot
> matplot.0D(out, lwd = 2)
> 
> ## Split y-variables in two groups
> matplot.0D(out, which = list(c(1,3), c(2,4)),
+            lty = c(1,2,1,2), col=c(4,4,5,5),
+            ylab = c("prey1,pred1", "prey2,pred2"))
> 
> ## =======================================================================
> ## Example 2. Add second and third output, and observations
> ## =======================================================================
> 
> # New runs with different parameter settings
> parms2      <- parms
> parms2$r[1] <- 0.2
> out2 <- ode(y, times, LVmatrix, parms2)
> 
> # New runs with different parameter settings
> parms3      <- parms
> parms3$r[1] <- 0.05
> out3 <- ode(y, times, LVmatrix, parms3)
> 
> # plot all three outputs
> plot(out, out2, out3, type = "l",
+      ylab = c("Prey 1", "Prey 2", "Pred 1", "Pred 2"),
+      xlab = "Time (d)", main = c("Prey 1", "Prey 2", "Pred 1", "Pred 2"),
+      col = c("red", "blue", "darkred"))
> 
> 
> ## 'observed' data
> obs <- as.data.frame(out[out[,1] %in% seq(10, 500, by = 30), ])
> 
> plot(out, which = "prey1", type = "l", obs = obs,
+      obspar = list(pch = 18, cex = 2))
> 
> plot(out, type = "l", obs = obs, col = "red")
> 
> matplot.0D(out, which = c("prey1", "pred1"), type = "l", obs = obs)
> 
> ## second set of 'observed' data and two outputs
> obs2 <- as.data.frame(out2[out2[,1] %in% seq(10, 500, by = 50), ])
> 
> ## manual xlim, log
> plot(out, out2, type = "l", obs = list(obs, obs2), col = c("red", "blue"),
+       obspar = list(pch = 18:19, cex = 2, col = c("red", "blue")),
+       log = c("y", ""), which = c("prey1", "prey1"),
+       xlim = list(c(100, 500), c(0, 400)))
> 
> ## data in 'long' format
> OBS <- data.frame(name = c(rep("prey1", 3), rep("prey2", 2)),
+                   time = c(10, 100, 250, 10, 400),
+                   value = c(0.05, 0.04, 0.7, 0.5, 1))
> OBS
   name time value
1 prey1   10  0.05
2 prey1  100  0.04
3 prey1  250  0.70
4 prey2   10  0.50
5 prey2  400  1.00
> plot(out, obs = OBS, obspar = c(pch = 18, cex = 2))
> 
> # a subset only:
> plot(out, subset = prey1 < 0.5, type = "p")
> 
> # Simple histogram
> hist(out, col = "darkblue", breaks = 50)
Error in plot.new() : write failed
Calls: hist ... hist -> hist.default -> plot -> plot.histogram -> plot.new
Execution halted
Error: internal read error in PDF_endpage
Fatal error: error during cleanup