- using R Under development (unstable) (2019-12-11 r77556)
- using platform: x86_64-pc-linux-gnu (64-bit)
- using session charset: ISO8859-15
- checking for file 'plot3D/DESCRIPTION' ... OK
- this is package 'plot3D' version '1.1.1'
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking serialization versions ... OK
- checking whether package 'plot3D' can be installed ... OK
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking 'build' directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking R files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... OK
- checking whether the package can be loaded with stated dependencies ... OK
- checking whether the package can be unloaded cleanly ... OK
- checking whether the namespace can be loaded with stated dependencies ... OK
- checking whether the namespace can be unloaded cleanly ... OK
- checking loading without being on the library search path ... OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [37s/41s] OK
- checking Rd files ... OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of 'data' directory ... OK
- checking data for non-ASCII characters ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking sizes of PDF files under 'inst/doc' ... OK
- checking installed files from 'inst/doc' ... OK
- checking files in 'vignettes' ... OK
- checking examples ... ERROR
Running examples in 'plot3D-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: 2D image and contour plots
> ### Title: Extended image and contour plots for 2-D (and 3-D) data.
> ### Aliases: image2D contour2D image2D.matrix image2D.array image2D.list
> ### Keywords: hplot
>
> ### ** Examples
>
> # save plotting parameters
> pm <- par("mfrow")
>
> ## =======================================================================
> ## Difference between x or y a vector/matrix and rasterImage
> ## =======================================================================
>
> par(mfrow = c(2, 2))
> x <- y <- 1:3
> z <- matrix (nrow = 3, ncol = 3, data = 1:9)
> image2D(z, x, y, border = "black")
> image2D(z, x, y, rasterImage = TRUE, border = "black")
> image2D(z, x = matrix(nrow = 3, ncol = 3, data = x),
+ y, border = "black")
> image2D(z, x, y, border = "black", theta = 45)
>
> ## =======================================================================
> ## shading, light, adding contours, points and lines
> ## =======================================================================
>
> par(mfrow = c(2, 2))
> nr <- nrow(volcano)
> nc <- ncol(volcano)
>
> image2D(volcano, x = 1:nr, y = 1:nc, lighting = TRUE,
+ main = "volcano", clab = "height, m")
>
> abline(v = seq(10, 80, by = 10))
> abline(h = seq(10, 60, by = 10))
> points(50, 30, pch = 3, cex = 5, lwd = 3, col = "white")
>
> image2D(z = volcano, x = 1:nr, y = 1:nc, lwd = 2, shade = 0.2,
+ main = "volcano", clab = "height, m")
>
> image2D(volcano, x = 1:nr, y = 1:nc, contour = TRUE, shade = 0.5, lphi = 0,
+ col = "lightblue", main = "volcano")
>
> breaks <- seq(90, 200, by = 10)
> image2D(volcano, x = 1:nr, y = 1:nc, col = jet.col(length(breaks)-1),
+ main = "volcano", clab = "height, m", breaks = breaks)
>
> ## =======================================================================
> ## Contour plots
> ## =======================================================================
>
> par(mfrow = c(2, 2))
> V <- volcano - 150
>
> # default, no color key
> contour2D(z = V, colkey = FALSE, lwd = 2)
>
> # imposed levels
> contour2D(z = V, lwd = 2, levels = seq(-40, 40, by = 20))
>
> # negative levels dashed
> contour2D(z = V, col = "black", lwd = 2,
+ levels = seq(0, 40, by = 20))
> contour2D(z = V, col = "black", lwd = 2, lty = 2,
+ levels = seq(-40, -20, by = 20), add = TRUE)
>
> # no labels, imposed number of levels, colorkey
> contour2D(z = V, lwd = 2, nlevels = 20, drawlabels = FALSE,
+ colkey = list(at = seq(-40, 40, by = 20)))
>
> ## =======================================================================
> ## A large data set, input is an array
> ## =======================================================================
>
> par(mfrow = c(1, 1))
> image2D(z = Oxsat$val[, , 1], x = Oxsat$lon, y = Oxsat$lat,
+ main = "surface oxygen saturation data 2005", NAcol = "black",
+ clab = c("","","%"))
>
> # images at first 9 depths - use subset to select them
> image2D(z = Oxsat$val, subset = 1:9,
+ x = Oxsat$lon, y = Oxsat$lat,
+ margin = c(1, 2), NAcol = "black",
+ xlab = "longitude", ylab = "latitude",
+ zlim = c(0, 115),
+ main = paste("depth ", Oxsat$depth[1:9], " m"),
+ mfrow = c(3, 3))
>
> # images at latitude - depth section - increase resolution
> z <- Oxsat$val[, Oxsat$lat > - 5 & Oxsat$lat < 5, ]
> image2D(z = z, x = Oxsat$lon, y = Oxsat$depth,
+ margin = c(1, 3), NAcol = "black",
+ resfac = 3, ylim = c(5000, 0))
>
> # show position of transects
> image2D(z = Oxsat$val[ , ,1],
+ x = Oxsat$lon, y = Oxsat$lat,
+ NAcol = "black")
> abline(h = Oxsat$lat[Oxsat$lat > - 5 & Oxsat$lat < 5])
>
> ## =======================================================================
> ## Image of a list of matrices
> ## =======================================================================
>
> listvolcano <- list(volcano = volcano, logvolcano = log(volcano))
> image2D(listvolcano, x = 1:nr, y = 1:nc, contour = TRUE,
+ main = c("volcano", "log(volcano)"),
+ clab = list("height, m", "log(m)"),
+ zlim = list(c(80, 200), c(4.4, 5.5)))
----------- FAILURE REPORT --------------
--- failure: the condition has length > 1 ---
--- srcref ---
:
--- package (from environment) ---
plot3D
--- call from context ---
image2D.list(listvolcano, x = 1:nr, y = 1:nc, contour = TRUE,
main = c("volcano", "log(volcano)"), clab = list("height, m",
"log(m)"), zlim = list(c(80, 200), c(4.4, 5.5)))
--- call from argument ---
if (!classz %in% c("matrix", "array")) stop("'z' should be a list with either matrices or arrays")
--- R stacktrace ---
where 1: image2D.list(listvolcano, x = 1:nr, y = 1:nc, contour = TRUE,
main = c("volcano", "log(volcano)"), clab = list("height, m",
"log(m)"), zlim = list(c(80, 200), c(4.4, 5.5)))
where 2: image2D(listvolcano, x = 1:nr, y = 1:nc, contour = TRUE, main = c("volcano",
"log(volcano)"), clab = list("height, m", "log(m)"), zlim = list(c(80,
200), c(4.4, 5.5)))
--- value of length: 2 type: logical ---
[1] FALSE FALSE
--- function from context ---
function (z, ...)
{
if (all(c("x", "y", "z") %in% names(z))) {
image2D.matrix(z = z$z, x = z$x, y = z$y, ...)
}
else {
nz <- length(z)
classz <- class(z[[1]])
if (!classz %in% c("matrix", "array"))
stop("'z' should be a list with either matrices or arrays")
DD <- dim(z[[1]])
if (length(DD) > 3 | length(DD) < 2)
stop("Can only make image of 2-D or 3-D array, 'z' has dimension ",
length(DD))
for (i in 2:nz) if (any(dim(z[[i]]) - DD != 0))
stop("elements of 'z' should have the same dimension, check element",
i)
if ("matrix" %in% classz) {
nc <- min(ceiling(sqrt(nz)), 3)
nr <- min(ceiling(nz/nc), 3)
}
else {
nc <- ceiling(sqrt(nz))
nr <- ceiling(nz/nc)
}
mfrow <- c(nr, nc)
par(mfrow = mfrow)
Ldots <- list(...)
Ldots$mfrow <- mfrow
if (!is.null(Ldots$main)) {
main <- rep(Ldots$main, length.out = nz)
Ldots$main <- NULL
}
else {
main <- names(z)
if (is.null(main))
main <- 1:nz
}
ask <- Ldots$ask
if (is.null(ask))
ask <- TRUE
Ldots$ask <- NULL
yylim <- expanddotslist(Ldots$ylim, nz)
xxlim <- expanddotslist(Ldots$xlim, nz)
zzlim <- expanddotslist(Ldots$zlim, nz)
zzlab <- expanddotslist(Ldots$clab, nz)
if (ask) {
oask <- devAskNewPage(TRUE)
on.exit(devAskNewPage(oask))
}
if ("matrix" %in% classz) {
Mtext <- Ldots$mtext
Ldots$mtext <- NULL
for (i in 1:nz) {
Ldots$main <- main[i]
Ldots$xlim <- xxlim[[i]]
Ldots$ylim <- yylim[[i]]
Ldots$zlim <- zzlim[[i]]
Ldots$clab <- zzlab[[i]]
LL <- c(list(z = z[[i]]), Ldots)
do.call(image2D, LL)
}
if (!is.null(Mtext))
mtext(text = Mtext, side = 3, outer = TRUE, line = par("oma")[3] -
1)
}
else {
margin <- Ldots$margin
Ldots$margin <- NULL
if (is.null(margin))
margin <- 1:2
if (length(margin) != 2)
stop("'margin' should contain two numbers, the x, y subscripts with which to make images")
if (max(margin) > 3 | min(margin) < 1)
stop("indexes in 'margin' should be inbetween 1 and 3")
index <- (1:3)[-margin]
subset <- Ldots$subset
Ldots$subset <- NULL
if (!is.null(subset)) {
if (is.numeric(subset)) {
isub <- subset
}
else {
e <- substitute(subset)
r <- eval(e, as.data.frame(z), parent.frame())
if (!is.logical(r))
stop("'subset' must evaluate to logical")
isub <- r & !is.na(r)
isub <- which(isub)
if (length(isub) == 0)
stop("cannot continue: nothing selected - check 'subset'")
}
}
else isub <- 1:DD[index]
nisub <- length(isub)
noplot <- prod(mfrow) - nz
if (noplot == 0)
noplot <- NULL
else noplot <- 1:noplot
Mtext <- Ldots$mtext
Ldots$mtext <- NULL
if (!is.null(Mtext))
Mtext <- rep(Mtext, length.out = nisub)
else Mtext <- isub
pline <- par("oma")[3] - 1
for (jj in 1:nisub) {
j <- isub[jj]
for (i in 1:nz) {
if (index == 1)
zz <- z[[i]][j, , ]
else if (index == 2)
zz <- z[[i]][, j, ]
else zz <- z[[i]][, , j]
if (margin[2] < margin[1])
zz <- t(zz)
Ldots$main <- main[i]
Ldots$xlim <- xxlim[[i]]
Ldots$ylim <- yylim[[i]]
Ldots$zlim <- zzlim[[i]]
Ldots$clab <- zzlab[[i]]
LL <- c(list(z = zz), Ldots)
do.call(image2D, LL)
}
for (i in noplot) plot(0, type = "n", xlab = "",
ylab = "", axes = FALSE, frame.plot = FALSE)
mtext(text = Mtext[jj], side = 3, outer = TRUE,
line = pline)
}
}
}
}
<bytecode: 0x3a6d5e0>
<environment: namespace:plot3D>
--- function search by body ---
Function image2D.list in namespace plot3D has this body.
----------- END OF FAILURE REPORT --------------
Error in if (!classz %in% c("matrix", "array")) stop("'z' should be a list with either matrices or arrays") :
the condition has length > 1
Calls: image2D -> image2D.list
Execution halted
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes in 'inst/doc' ... OK
- checking re-building of vignette outputs ... [23s/32s] OK
- checking PDF version of manual ... OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 1 ERROR