https://github.com/cran/fields
Tip revision: 6769ffc81115fbf0bf7d9c566cf7ac81be0049dc authored by Doug Nychka on 25 July 2005, 00:00:00 UTC
version 3.04
version 3.04
Tip revision: 6769ffc
image.plot.info.r
"image.plot.info" <-
function(...)
{
temp <- list(...)
#
xlim <- NA
ylim <- NA
zlim <- NA
#
# go through various cases of what these can be
#
if(is.list(temp[[1]])) {
xlim <- range(temp[[1]]$x, na.rm = TRUE)
ylim <- range(temp[[1]]$y, na.rm = TRUE)
zlim <- range(temp[[1]]$z, na.rm = TRUE)
}
if(is.matrix(temp[[1]])) {
xlim <- c(0,1)
ylim <- c(0,1)
zlim <- range(temp[[1]], na.rm = TRUE)
}
if( length( temp)>=3){
if(is.matrix(temp[[3]])) {
xlim <- range(temp[[1]], na.rm = TRUE)
ylim <- range(temp[[2]], na.rm = TRUE)
zlim <- range(temp[[3]], na.rm = TRUE)
}
}
xthere <- match("x", names(temp))
ythere <- match("y", names(temp))
zthere <- match("z", names(temp))
if(!is.na(zthere))
zlim <- range(temp$z, na.rm = TRUE)
if(!is.na(xthere))
xlim <- range(temp$x, na.rm = TRUE)
if(!is.na(ythere))
ylim <- range(temp$y, na.rm = TRUE)
if(!is.null(temp$zlim))
zlim <- temp$zlim
if(!is.null(temp$xlim))
xlim <- temp$xlim
if(!is.null(temp$ylim))
ylim <- temp$ylim
list(xlim = xlim, ylim = ylim, zlim = zlim)
}