CRAN Package Check Results for Package autopls

Last updated on 2020-02-19 10:48:46 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.3 4.50 44.13 48.63 ERROR
r-devel-linux-x86_64-debian-gcc 1.3 3.86 33.48 37.34 ERROR
r-devel-linux-x86_64-fedora-clang 1.3 57.02 ERROR
r-devel-linux-x86_64-fedora-gcc 1.3 55.76 ERROR
r-devel-windows-ix86+x86_64 1.3 7.00 57.00 64.00 NOTE
r-devel-windows-ix86+x86_64-gcc8 1.3 12.00 81.00 93.00 NOTE
r-patched-linux-x86_64 1.3 3.73 47.87 51.60 NOTE
r-patched-solaris-x86 1.3 85.60 NOTE
r-release-linux-x86_64 1.3 3.93 47.35 51.28 NOTE
r-release-windows-ix86+x86_64 1.3 6.00 64.00 70.00 NOTE
r-release-osx-x86_64 1.3 NOTE
r-oldrel-windows-ix86+x86_64 1.3 5.00 60.00 65.00 NOTE
r-oldrel-osx-x86_64 1.3 NOTE

Check Details

Version: 1.3
Check: R code for possible problems
Result: NOTE
    autopls: no visible global function definition for 'model.response'
    autopls: no visible global function definition for 'model.matrix'
    autopls: no visible binding for global variable 'var'
    autopls : ac: no visible global function definition for 'cor'
    autopls : ac: no visible global function definition for 'median'
    autopls : tryaround: no visible global function definition for 'sd'
    autopls: no visible global function definition for 'coef'
    autopls: no visible global function definition for 'flush.console'
    coef.autopls: no visible global function definition for 'coef'
    plot.autopls : ovpplot: no visible global function definition for 'par'
    plot.autopls : ovpplot: no visible global function definition for
     'fitted'
    plot.autopls : ovpplot: no visible global function definition for
     'axis'
    plot.autopls : ovpplot: no visible global function definition for
     'mtext'
    plot.autopls : ovpplot: no visible global function definition for
     'points'
    plot.autopls : ovpplot: no visible global function definition for 'lm'
    plot.autopls : ovpplot: no visible global function definition for
     'text'
    plot.autopls : ovpplot: no visible global function definition for
     'legend'
    plot.autopls : ovpplot: no visible global function definition for 'box'
    plot.autopls : ovpplot: no visible global function definition for
     'clip'
    plot.autopls : ovpplot: no visible global function definition for
     'abline'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'par'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'predict'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'axis'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'mtext'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'points'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'text'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'lm'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'legend'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'box'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'clip'
    plot.autopls : ovpplot.testset: no visible global function definition
     for 'abline'
    plot.autopls : rmseplot: no visible global function definition for
     'par'
    plot.autopls : rmseplot: no visible global function definition for
     'lines'
    plot.autopls : rmseplot: no visible global function definition for
     'grey'
    plot.autopls : rmseplot: no visible global function definition for
     'points'
    plot.autopls : rmseplot: no visible global function definition for
     'barplot'
    plot.autopls : rmseplot: no visible global function definition for
     'axis'
    plot.autopls : rmseplot: no visible global function definition for
     'mtext'
    plot.autopls : rmseplot: no visible global function definition for
     'box'
    plot.autopls : rmseplot: no visible global function definition for
     'legend'
    plot.autopls : rmseplot.testset: no visible global function definition
     for 'par'
    plot.autopls : rmseplot.testset: no visible global function definition
     for 'lines'
    plot.autopls : rmseplot.testset: no visible global function definition
     for 'grey'
    plot.autopls : rmseplot.testset: no visible global function definition
     for 'points'
    plot.autopls : rmseplot.testset: no visible global function definition
     for 'barplot'
    plot.autopls : rmseplot.testset: no visible global function definition
     for 'axis'
    plot.autopls : rmseplot.testset: no visible global function definition
     for 'mtext'
    plot.autopls : rmseplot.testset: no visible global function definition
     for 'box'
    plot.autopls : rmseplot.testset: no visible global function definition
     for 'legend'
    plot.autopls : rcplot: no visible global function definition for 'coef'
    plot.autopls : rcplot: no visible global function definition for 'par'
    plot.autopls : rcplot: no visible global function definition for
     'title'
    plot.autopls : rcplot: no visible global function definition for 'rect'
    plot.autopls : rcplot: no visible global function definition for
     'axTicks'
    plot.autopls : rcplot: no visible global function definition for 'grey'
    plot.autopls : rcplot: no visible global function definition for
     'lines'
    plot.autopls : rcplot: no visible global function definition for 'axis'
    plot.autopls : rcplot: no visible global function definition for
     'mtext'
    plot.autopls : rcplot: no visible global function definition for
     'points'
    plot.autopls : rcplot: no visible global function definition for 'box'
    plot.autopls : rcplot: no visible global function definition for
     'legend'
    plot.autopls : x.influence: no visible global function definition for
     'par'
    plot.autopls : x.influence: no visible global function definition for
     'text'
    plot.autopls : x.influence: no visible global function definition for
     'points'
    plot.autopls : y.influence: no visible global function definition for
     'residuals'
    plot.autopls : y.influence: no visible global function definition for
     'par'
    plot.autopls : y.influence: no visible global function definition for
     'text'
    plot.autopls : y.influence: no visible global function definition for
     'points'
    plot.autopls : metaplot: no visible global function definition for
     'par'
    plot.autopls : metaplot: no visible global function definition for
     'rect'
    plot.autopls : metaplot: no visible global function definition for
     'lines'
    plot.autopls : metaplot: no visible global function definition for
     'grey'
    plot.autopls : metaplot: no visible global function definition for
     'points'
    plot.autopls : metaplot: no visible global function definition for
     'text'
    plot.autopls : metaplot: no visible global function definition for
     'axis'
    plot.autopls : metaplot: no visible global function definition for
     'mtext'
    plot.autopls : metaplot: no visible global function definition for
     'box'
    plot.autopls : pL: no visible global function definition for
     'as.graphicsAnnot'
    plot.autopls : pL: no visible global function definition for 'par'
    plot.autopls : pL: no visible global function definition for
     'xy.coords'
    plot.autopls : pL: no visible global function definition for 'strwidth'
    plot.autopls : pL: no visible global function definition for
     'strheight'
    plot.autopls : pL : SANN: no visible global function definition for
     'runif'
    plot.autopls: no visible global function definition for 'dev.new'
    plot.autopls: no visible global function definition for 'devAskNewPage'
    predict.autopls: no visible global function definition for 'coef'
    predict.autopls: no visible global function definition for
     'txtProgressBar'
    predict.autopls: no visible global function definition for
     'setTxtProgressBar'
    predict.slim: no visible global function definition for 'coef'
    predict.slim: no visible global function definition for
     'txtProgressBar'
    predict.slim: no visible global function definition for
     'setTxtProgressBar'
    repeatedCV: no visible global function definition for 'sd'
    residuals.autopls: no visible global function definition for
     'residuals'
    slim: no visible global function definition for 'coef'
    Undefined global functions or variables:
     abline as.graphicsAnnot axTicks axis barplot box clip coef cor
     dev.new devAskNewPage fitted flush.console grey legend lines lm
     median model.matrix model.response mtext par points predict rect
     residuals runif sd setTxtProgressBar strheight strwidth text title
     txtProgressBar var xy.coords
    Consider adding
     importFrom("grDevices", "as.graphicsAnnot", "dev.new", "devAskNewPage",
     "grey", "xy.coords")
     importFrom("graphics", "abline", "axTicks", "axis", "barplot", "box",
     "clip", "legend", "lines", "mtext", "par", "points", "rect",
     "strheight", "strwidth", "text", "title")
     importFrom("stats", "coef", "cor", "fitted", "lm", "median",
     "model.matrix", "model.response", "predict", "residuals",
     "runif", "sd", "var")
     importFrom("utils", "flush.console", "setTxtProgressBar",
     "txtProgressBar")
    to your NAMESPACE file.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 1.3
Check: examples
Result: ERROR
    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: 0x3dedd48>
    <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
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.3
Check: examples
Result: ERROR
    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: 0x55812546af40>
    <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
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.3
Check: examples
Result: ERROR
    Running examples in ‘autopls-Ex.R’ failed
    The error most likely occurred in:
    
    > ### 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: 0x3df8758>
    <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
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 1.3
Check: examples
Result: ERROR
    Running examples in ‘autopls-Ex.R’ failed
    The error most likely occurred in:
    
    > ### 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: 0x4d0d4f0>
    <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
Flavor: r-devel-linux-x86_64-fedora-gcc