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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: Scatter plots
> ### Title: Colored scatter plots and text in 2-D and 3-D
> ### Aliases: scatter3D text3D points3D lines3D scatter2D points2D lines2D
> ###   text2D
> ### Keywords: hplot
> 
> ### ** Examples
> 
> # save plotting parameters
>  pm <- par("mfrow")
> 
>  
> ## =======================================================================
> ## A sphere 
> ## =======================================================================
> 
>  par(mfrow = c(1, 1))
>  M  <- mesh(seq(0, 2*pi, length.out = 100), 
+             seq(0,   pi, length.out = 100))
>  u  <- M$x ; v  <- M$y
> 
>  x <- cos(u)*sin(v)
>  y <- sin(u)*sin(v)
>  z <- cos(v)
> 
> # full  panels of box are drawn (bty = "f")
>  scatter3D(x, y, z, pch = ".", col = "red", 
+            bty = "f", cex = 2, colkey = FALSE)
> 
> ## =======================================================================
> ## Different types
> ## =======================================================================
> 
>  par (mfrow = c(2, 2))
>  z <- seq(0, 10, 0.2)
>  x <- cos(z)
>  y <- sin(z)*z
> 
> # greyish background for the boxtype (bty = "g") 
>  scatter3D(x, y, z, phi = 0, bty = "g",
+            pch = 20, cex = 2, ticktype = "detailed")
> # add another point
>  scatter3D(x = 0, y = 0, z = 0, add = TRUE, colkey = FALSE, 
+            pch = 18, cex = 3, col = "black")
> 
> # add text
>  text3D(x = cos(1:10), y = (sin(1:10)*(1:10) - 1), 
+         z = 1:10, colkey = FALSE, add = TRUE, 
+         labels = LETTERS[1:10], col = c("black", "red"))
> 
> # line plot
>  scatter3D(x, y, z, phi = 0, bty = "g", type = "l", 
+            ticktype = "detailed", lwd = 4)
> 
> # points and lines
>  scatter3D(x, y, z, phi = 0, bty = "g", type = "b", 
+            ticktype = "detailed", pch = 20, 
+            cex = c(0.5, 1, 1.5))
> 
> # vertical lines
>  scatter3D(x, y, z, phi = 0, bty = "g",  type = "h", 
+            ticktype = "detailed")
> 
> ## =======================================================================
> ## With confidence interval
> ## =======================================================================
> 
>  x <- runif(20)
>  y <- runif(20)
>  z <- runif(20)
> 
>  par(mfrow = c(1, 1))
>  CI <- list(z = matrix(nrow = length(x),
+                        data = rep(0.05, 2*length(x))))
> 
> # greyish background for the boxtype (bty = "g")
>  scatter3D(x, y, z, phi = 0, bty = "g", CI = CI,
+    col = gg.col(100), pch = 18, cex = 2, ticktype = "detailed",
+    xlim = c(0, 1), ylim = c(0, 1), zlim = c(0, 1))
> 
> # add new set of points
>  x <- runif(20)
>  y <- runif(20)
>  z <- runif(20)
> 
>  CI2 <- list(x = matrix(nrow = length(x),
+                        data = rep(0.05, 2*length(x))),
+              z = matrix(nrow = length(x),
+                        data = rep(0.05, 2*length(x))))
> 
>  scatter3D(x, y, z, CI = CI2, add = TRUE, col = "red", pch = 16)
> 
> ## =======================================================================
> ## With a surface
> ## =======================================================================
> 
>  par(mfrow = c(1, 1))
>  
> # surface = volcano
>  M <- mesh(1:nrow(volcano), 1:ncol(volcano))
> 
> # 100 points above volcano 
>  N  <- 100
>  xs <- runif(N) * 87
>  ys <- runif(N) * 61
>  zs <- runif(N)*50 + 154
>   
> # scatter + surface
>  scatter3D(xs, ys, zs, ticktype = "detailed", pch = 16, 
+    bty = "f", xlim = c(1, 87), ylim = c(1,61), zlim = c(94, 215), 
+    surf = list(x = M$x, y = M$y, z = volcano,  
+                NAcol = "grey", shade = 0.1))
>  
> ## =======================================================================
> ## A surface and CI
> ## =======================================================================
> 
>  par(mfrow = c(1, 1))
>  M <- mesh(seq(0, 2*pi, length = 30), (1:30)/100)
>  z <- with (M, sin(x) + y)
>  
> # points 'sampled'
>  N <- 30
>  xs <- runif(N) * 2*pi
>  ys <- runif(N) * 0.3
> 
>  zs <- sin(xs) + ys + rnorm(N)*0.3
>  
>  CI <- list(z = matrix(nrow = length(xs), 
+                        data = rep(0.3, 2*length(xs))),
+             lwd = 3)
>   
> # facets = NA makes a transparent surface; borders are black
>  scatter3D(xs, ys, zs, ticktype = "detailed", pch = 16, 
+    xlim = c(0, 2*pi), ylim = c(0, 0.3), zlim = c(-1.5, 1.5), 
+    CI = CI, theta = 20, phi = 30, cex = 2,
+    surf = list(x = M$x, y = M$y, z = z, border = "black", facets = NA)
+    )
> 
> ## =======================================================================
> ## droplines till the fitted surface
> ## =======================================================================
> 
>  with (mtcars, {
+ 
+   # linear regression
+    fit <- lm(mpg ~ wt + disp)
+ 
+   # predict values on regular xy grid
+    wt.pred <- seq(1.5, 5.5, length.out = 30)
+    disp.pred <- seq(71, 472, length.out = 30)
+    xy <- expand.grid(wt = wt.pred, 
+                      disp = disp.pred)
+ 
+    mpg.pred <- matrix (nrow = 30, ncol = 30, 
+       data = predict(fit, newdata = data.frame(xy), 
+       interval = "prediction"))
+ 
+ # fitted points for droplines to surface
+    fitpoints <- predict(fit) 
+ 
+    scatter3D(z = mpg, x = wt, y = disp, pch = 18, cex = 2, 
+       theta = 20, phi = 20, ticktype = "detailed",
+       xlab = "wt", ylab = "disp", zlab = "mpg",  
+       surf = list(x = wt.pred, y = disp.pred, z = mpg.pred,  
+                   facets = NA, fit = fitpoints),
+       main = "mtcars")
+   
+  })
Error in matrix(nrow = 30, ncol = 30, data = predict(fit, newdata = data.frame(xy),  : 
  data length differs from size of matrix: [2700 != 30 x 30]
Calls: with -> with.default -> eval -> eval -> matrix
Execution halted