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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: postprocessing
> ### Title: Test for model extrapolations or interpolations and removal of
> ###   bold predictions in autopls
> ### Aliases: postprocessing liability confine
> ### Keywords: regression multivariate
> 
> ### ** Examples
> 
>   ## load predictor and response data to the current environment
>   data (murnau.X)
>   data (murnau.Y)
>   
>   ## call autopls with the standard options
>   model <- autopls (murnau.Y ~ murnau.X)
1   Pred: 26  LV: 3   R2v: 0.74   RMSEv: 4.727  
2   Pred: 23  LV: 3   R2v: 0.742  RMSEv: 4.705  Criterion: A1
3   Pred: 20  LV: 3   R2v: 0.749  RMSEv: 4.645  Criterion: A4
4   Pred: 18  LV: 3   R2v: 0.752  RMSEv: 4.611  Criterion: A4
5   Pred: 16  LV: 3   R2v: 0.752  RMSEv: 4.61   Criterion: A4
6   Pred: 13  LV: 3   R2v: 0.76   RMSEv: 4.537  Criterion: A1
7   Pred: 11  LV: 3   R2v: 0.768  RMSEv: 4.466  Criterion: A4
8   Pred: 9   LV: 3   R2v: 0.775  RMSEv: 4.397  Criterion: A4

Predictors: 9   Observations: 40   Latent vectors: 3   Run: 8 
RMSE(CAL): 4.09   RMSE(LOO): 4.4   
R2(CAL): 0.805    R2(LOO): 0.775   
> 
>   ## new data
>   new <- murnau.X + 500 
> 
>   ## prediction
>   pred <- predict (model, new)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
autopls
 --- call from context --- 
predict.autopls(model, new)
 --- call from argument --- 
if (class(dat) == "RasterBrick") method <- "rst"
 --- R stacktrace ---
where 1: predict.autopls(model, new)
where 2: predict(model, new)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (object, dat, ...) 
{
    prep <- unlist(object$metapls$preprocessing)
    subs <- unlist(object$predictors)
    scal <- unlist(object$metapls$scaling)
    comp <- get.lv(object)
    if (is.vector(dat)) 
        method <- "vec"
    if (is.matrix(dat)) 
        method <- "mat"
    if (class(dat) == "RasterBrick") 
        method <- "rst"
    if (class(dat) == "RasterStack") 
        method <- "rst"
    cfs <- as.vector(coef(object, intercept = TRUE))
    cf <- cfs[-1]
    ic <- cfs[1]
    if (scal == TRUE) 
        cf <- cf/as.vector(object$scale)
    if (method == "vec") {
        dat <- dat[subs]
        if (prep != "none") 
            dat <- prepro(X = dat, method = "bn")
        cfdat <- dat * cf
        prediction <- sum(cfdat) + ic
    }
    if (method == "mat") {
        dat <- dat[, subs]
        if (prep != "none") 
            dat <- prepro(dat, method = "bn")
        cfdat <- t(dat) * cf
        prediction <- apply(cfdat, 2, sum) + ic
    }
    if (method == "rst") {
        dropped <- which(!subs)
        if (length(subs) != raster::nlayers(dat)) 
            stop(paste("Number of layers = ", raster::nlayers(dat), 
                ", predictors before autopls backward selection) = ", 
                length(subs), sep = ""))
        else dat <- raster::dropLayer(dat, dropped)
        maxsize <- 5e+05
        if ("bn" %in% prep) 
            maxsize <- 50000
        dims <- dim(dat)
        if (prod(dims) > maxsize) {
            rows <- ceiling(maxsize/prod(dims[2:3]))
            lower <- seq(1, dims[1], rows)
            upper <- seq(rows, dims[1], rows)
            if (dims[1] > max(upper)) 
                upper <- c(upper, dims[1])
            tiles <- length(lower)
            res <- vector()
            prog <- tiles > 4
            if (prog) 
                pb <- txtProgressBar(min = 0, max = dims[1], 
                  char = ".", width = 45, style = 3)
            for (i in 1:tiles) {
                v <- raster::getValuesBlock(dat, row = lower[i], 
                  nrows = (upper[i] - lower[i] + 1))
                if (prep != "none") 
                  v <- prepro(v, method = "bn")
                cfdat <- sweep(v, 2, cf, "*")
                res <- c(res, rowSums(cfdat) + ic)
                if (prog) 
                  setTxtProgressBar(pb, upper[i])
            }
            if (prog) 
                close(pb)
            prediction <- raster::raster(dat, 1)
            raster::values(prediction) <- res
        }
        else {
            if (prep != "none") 
                dat <- prepro(dat, method = "bn")
            cfdat <- dat * cf
            prediction <- raster::stackApply(cfdat, rep(1, sum(subs)), 
                sum) + ic
        }
    }
    return(prediction)
}
<bytecode: 0x3cb7af0>
<environment: namespace:autopls>
 --- function search by body ---
Function predict.autopls in namespace autopls has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(dat) == "RasterBrick") method <- "rst" : 
  the condition has length > 1
Calls: predict -> predict.autopls
Execution halted