CRAN Package Check Results for Package SPOT

Last updated on 2019-12-12 17:49:35 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 2.0.4 10.32 112.76 123.08 ERROR
r-devel-linux-x86_64-debian-gcc 2.0.4 9.29 157.13 166.42 OK
r-devel-linux-x86_64-fedora-clang 2.0.4 172.79 OK
r-devel-linux-x86_64-fedora-gcc 2.0.4 164.56 OK
r-devel-windows-ix86+x86_64 2.0.4 25.00 218.00 243.00 OK
r-devel-windows-ix86+x86_64-gcc8 2.0.4 29.00 204.00 233.00 OK
r-patched-linux-x86_64 2.0.4 9.50 117.17 126.67 OK
r-patched-solaris-x86 2.0.4 215.30 OK
r-release-linux-x86_64 2.0.4 9.99 116.56 126.55 OK
r-release-windows-ix86+x86_64 2.0.4 28.00 132.00 160.00 OK
r-release-osx-x86_64 2.0.4 OK
r-oldrel-windows-ix86+x86_64 2.0.4 16.00 122.00 138.00 OK
r-oldrel-osx-x86_64 2.0.4 OK

Check Details

Version: 2.0.4
Check: examples
Result: ERROR
    Running examples in 'SPOT-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: buildEnsembleStack
    > ### Title: Ensemble: Stacking
    > ### Aliases: buildEnsembleStack
    >
    > ### ** Examples
    >
    > ## Create a test function: branin
    > braninFunction <- function (x) {
    + (x[2] - 5.1/(4 * pi^2) * (x[1] ^2) + 5/pi * x[1] - 6)^2 +
    + 10 * (1 - 1/(8 * pi)) * cos(x[1] ) + 10
    + }
    > ## Create design points
    > x <- cbind(runif(20)*15-5,runif(20)*15)
    > ## Compute observations at design points
    > y <- as.matrix(apply(x,1,braninFunction))
    > ## Create model with default settings
    > fit <- buildEnsembleStack(x,y)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    SPOT
     --- call from context ---
    krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     --- call from argument ---
    if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA, mu = NA,
     SSQ = NA))
    }
     --- R stacktrace ---
    where 1: krigingLikelihood(x, fX, fy, optimizeP, useLambda)
    where 2: FUN(newX[, i], ...)
    where 3: apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
    where 4: fun(matrix(x, 1), ...)
    where 5: fn(par, ...)
    where 6: (function (par)
    fn(par, ...))(c(0.09, 0.09, 0))
    where 7: optim(par = x, fn = fn, lower = lower, upper = upper, control = control,
     method = "L-BFGS-B", ...)
    where 8: fit$algTheta(x = x0, fun = function(x, fX, fy, optimizeP, useLambda) {
     if (!is.matrix(x)) {
     fitFun(x, fX, fy, optimizeP, useLambda)
     }
     else {
     apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     }
    }, lower = LowerTheta, upper = UpperTheta, control = opts, fX = A,
     fy = fit$y, optimizeP = fit$optimizeP, useLambda = fit$useLambda)
    where 9: control$modelL0[[j]](xt, as.matrix(yt), control$modelL0Control[[j]])
    where 10: buildEnsembleStack(x, y)
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (x, AX, Ay, optimizeP = FALSE, useLambda = TRUE)
    {
     nx <- nrow(AX)
     theta <- 10^x[1:nx]
     if (optimizeP) {
     AX <- abs(AX)^(x[(nx + 1):(2 * nx)])
     }
     lambda <- 0
     if (useLambda)
     lambda <- 10^x[length(x)]
     if (any(theta == 0) || any(is.infinite(c(theta, lambda)))) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, ssq = NA))
     }
     n <- dim(Ay)[1]
     Psi <- exp(-matrix(colSums(theta * AX), n, n))
     if (useLambda)
     Psi <- Psi + diag(lambda, n)
     if (any(is.infinite(Psi))) {
     penalty <- 10000
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     kap <- rcond(Psi)
     if (is.na(kap))
     kap <- 0
     if (kap < 1e-10) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA, a = NA, U = NA, isIndefinite = TRUE))
     }
     cholPsi <- try(chol(Psi), TRUE)
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     LnDetPsi <- 2 * sum(log(abs(diag(cholPsi))))
     Psinv <- try(chol2inv(cholPsi), TRUE)
     if (class(Psinv) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     psisum <- sum(Psinv)
     if (psisum == 0) {
     psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
     if (psisum == 0) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     }
     mu <- sum(Psinv %*% Ay)/psisum
     if (is.infinite(mu) | is.na(mu)) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     yonemu <- Ay - mu
     SigmaSqr <- (t(yonemu) %*% Psinv %*% yonemu)/n
     if (SigmaSqr < 0) {
     return(list(NegLnLike = 10000 - SigmaSqr, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     NegLnLike <- n * log(SigmaSqr) + LnDetPsi
     if (is.na(NegLnLike) | is.infinite(NegLnLike))
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     list(NegLnLike = NegLnLike, Psi = Psi, Psinv = Psinv, mu = mu,
     yonemu = yonemu, ssq = SigmaSqr)
    }
    <bytecode: 0xc38ad98>
    <environment: namespace:SPOT>
     --- function search by body ---
    Function krigingLikelihood in namespace SPOT has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(cholPsi) == "try-error") { :
     the condition has length > 1
    Calls: buildEnsembleStack ... <Anonymous> -> fn -> fun -> apply -> FUN -> krigingLikelihood
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 2.0.4
Check: tests
Result: ERROR
     Running 'testthat.R' [9s/11s]
    Running the tests in 'tests/testthat.R' failed.
    Complete output:
     > library(testthat)
     > library(SPOT)
     >
     > test_check("SPOT")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     SPOT
     --- call from context ---
     krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     --- call from argument ---
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA, mu = NA,
     SSQ = NA))
     }
     --- R stacktrace ---
     where 1: krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     where 2: FUN(newX[, i], ...)
     where 3: apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     where 4: fun(matrix(x, 1), ...)
     where 5: fn(par, ...)
     where 6: (function (par)
     fn(par, ...))(c(0.05, 0.05, 0))
     where 7: optim(par = x, fn = fn, lower = lower, upper = upper, control = control,
     method = "L-BFGS-B", ...)
     where 8: fit$algTheta(x = x0, fun = function(x, fX, fy, optimizeP, useLambda) {
     if (!is.matrix(x)) {
     fitFun(x, fX, fy, optimizeP, useLambda)
     }
     else {
     apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     }
     }, lower = LowerTheta, upper = UpperTheta, control = opts, fX = A,
     fy = fit$y, optimizeP = fit$optimizeP, useLambda = fit$useLambda)
     where 9: control$model(x = x, y = y, control = control$modelControl)
     where 10: spotLoop(x = x, y = y, fun = fun, lower = lower, upper = upper,
     control = control, ...)
     where 11 at testthat/test.inequalityConstraint.R#32: spot(, fun = funSphere, lower = c(-10, -20), upper = c(20, 8),
     control = list(funEvals = 15, modelControl = list(target = "ei"),
     optimizer = optimNLOPTR, optimizerControl = contr))
     where 12: eval(code, test_env)
     where 13: eval(code, test_env)
     where 14: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 15: doTryCatch(return(expr), name, parentenv, handler)
     where 16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 17: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 18: doTryCatch(return(expr), name, parentenv, handler)
     where 19: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 20: tryCatchList(expr, classes, parentenv, handlers)
     where 21: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 22: test_code(desc, code, env = parent.frame())
     where 23 at testthat/test.inequalityConstraint.R#26: test_that("check SPOT+NLOPTR with inequality constraints but with default design",
     {
     contr <- list()
     contr$eval_g_ineq <- function(x) 1 + x[1] - x[2]
     contr$funEvals <- 100
     contr$opts$algorithm <- "NLOPT_GN_ISRES"
     res <- spot(, fun = funSphere, lower = c(-10, -20), upper = c(20,
     8), control = list(funEvals = 15, modelControl = list(target = "ei"),
     optimizer = optimNLOPTR, optimizerControl = contr))
     res$xbest
     res$ybest
     expect_true(!all(apply(res$x, 1, contr$eval_g_ineq) <=
     0))
     })
     where 24: eval(code, test_env)
     where 25: eval(code, test_env)
     where 26: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 27: doTryCatch(return(expr), name, parentenv, handler)
     where 28: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 29: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 30: doTryCatch(return(expr), name, parentenv, handler)
     where 31: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 32: tryCatchList(expr, classes, parentenv, handlers)
     where 33: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 34: test_code(NULL, exprs, env)
     where 35: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 36: force(code)
     where 37: doWithOneRestart(return(expr), restart)
     where 38: withOneRestart(expr, restarts[[1L]])
     where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 40: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 41: FUN(X[[i]], ...)
     where 42: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 43: force(code)
     where 44: doWithOneRestart(return(expr), restart)
     where 45: withOneRestart(expr, restarts[[1L]])
     where 46: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 47: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 48: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 49: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 50: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 51: test_check("SPOT")
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (x, AX, Ay, optimizeP = FALSE, useLambda = TRUE)
     {
     nx <- nrow(AX)
     theta <- 10^x[1:nx]
     if (optimizeP) {
     AX <- abs(AX)^(x[(nx + 1):(2 * nx)])
     }
     lambda <- 0
     if (useLambda)
     lambda <- 10^x[length(x)]
     if (any(theta == 0) || any(is.infinite(c(theta, lambda)))) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, ssq = NA))
     }
     n <- dim(Ay)[1]
     Psi <- exp(-matrix(colSums(theta * AX), n, n))
     if (useLambda)
     Psi <- Psi + diag(lambda, n)
     if (any(is.infinite(Psi))) {
     penalty <- 10000
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     kap <- rcond(Psi)
     if (is.na(kap))
     kap <- 0
     if (kap < 1e-10) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA, a = NA, U = NA, isIndefinite = TRUE))
     }
     cholPsi <- try(chol(Psi), TRUE)
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     LnDetPsi <- 2 * sum(log(abs(diag(cholPsi))))
     Psinv <- try(chol2inv(cholPsi), TRUE)
     if (class(Psinv) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     psisum <- sum(Psinv)
     if (psisum == 0) {
     psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
     if (psisum == 0) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     }
     mu <- sum(Psinv %*% Ay)/psisum
     if (is.infinite(mu) | is.na(mu)) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     yonemu <- Ay - mu
     SigmaSqr <- (t(yonemu) %*% Psinv %*% yonemu)/n
     if (SigmaSqr < 0) {
     return(list(NegLnLike = 10000 - SigmaSqr, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     NegLnLike <- n * log(SigmaSqr) + LnDetPsi
     if (is.na(NegLnLike) | is.infinite(NegLnLike))
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     list(NegLnLike = NegLnLike, Psi = Psi, Psinv = Psinv, mu = mu,
     yonemu = yonemu, ssq = SigmaSqr)
     }
     <bytecode: 0xbdc9a98>
     <environment: namespace:SPOT>
     --- function search by body ---
     Function krigingLikelihood in namespace SPOT has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 1. Error: check SPOT+NLOPTR with inequality constraints but with default desi
     the condition has length > 1
     Backtrace:
     1. SPOT::spot(...)
     2. SPOT::spotLoop(...)
     3. control$model(x = x, y = y, control = control$modelControl)
     4. fit$algTheta(...)
     5. stats::optim(...)
     7. SPOT:::fn(par, ...)
     8. SPOT:::fun(matrix(x, 1), ...)
     9. base::apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     10. SPOT:::FUN(newX[, i], ...)
     11. SPOT::krigingLikelihood(x, fX, fy, optimizeP, useLambda)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     SPOT
     --- call from context ---
     krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     --- call from argument ---
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA, mu = NA,
     SSQ = NA))
     }
     --- R stacktrace ---
     where 1: krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     where 2: FUN(newX[, i], ...)
     where 3: apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     where 4: fun(matrix(x, 1), ...)
     where 5: fn(par, ...)
     where 6: (function (par)
     fn(par, ...))(c(0.05, 0.05, 0))
     where 7: optim(par = x, fn = fn, lower = lower, upper = upper, control = control,
     method = "L-BFGS-B", ...)
     where 8: fit$algTheta(x = x0, fun = function(x, fX, fy, optimizeP, useLambda) {
     if (!is.matrix(x)) {
     fitFun(x, fX, fy, optimizeP, useLambda)
     }
     else {
     apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     }
     }, lower = LowerTheta, upper = UpperTheta, control = opts, fX = A,
     fy = fit$y, optimizeP = fit$optimizeP, useLambda = fit$useLambda)
     where 9: control$model(x = x, y = y, control = control$modelControl)
     where 10: spotLoop(x = x, y = y, fun = fun, lower = lower, upper = upper,
     control = control, ...)
     where 11 at testthat/test.inequalityConstraint.R#52: spot(, fun = funSphere, lower = c(-10, -20), upper = c(20, 8),
     control = list(funEvals = 15, modelControl = list(target = "ei"),
     optimizer = optimNLOPTR, optimizerControl = contr, designControl = list(inequalityConstraint = contr$eval_g_ineq)))
     where 12: eval(code, test_env)
     where 13: eval(code, test_env)
     where 14: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 15: doTryCatch(return(expr), name, parentenv, handler)
     where 16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 17: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 18: doTryCatch(return(expr), name, parentenv, handler)
     where 19: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 20: tryCatchList(expr, classes, parentenv, handlers)
     where 21: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 22: test_code(desc, code, env = parent.frame())
     where 23 at testthat/test.inequalityConstraint.R#46: test_that("check SPOT+NLOPTR with inequality constraints also in design",
     {
     contr <- list()
     contr$eval_g_ineq <- function(x) 1 + x[1] - x[2]
     contr$funEvals <- 100
     contr$opts$algorithm <- "NLOPT_GN_ISRES"
     res <- spot(, fun = funSphere, lower = c(-10, -20), upper = c(20,
     8), control = list(funEvals = 15, modelControl = list(target = "ei"),
     optimizer = optimNLOPTR, optimizerControl = contr,
     designControl = list(inequalityConstraint = contr$eval_g_ineq)))
     res$xbest
     res$ybest
     expect_true(all(apply(res$x, 1, contr$eval_g_ineq) <=
     0))
     })
     where 24: eval(code, test_env)
     where 25: eval(code, test_env)
     where 26: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 27: doTryCatch(return(expr), name, parentenv, handler)
     where 28: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 29: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 30: doTryCatch(return(expr), name, parentenv, handler)
     where 31: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 32: tryCatchList(expr, classes, parentenv, handlers)
     where 33: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 34: test_code(NULL, exprs, env)
     where 35: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 36: force(code)
     where 37: doWithOneRestart(return(expr), restart)
     where 38: withOneRestart(expr, restarts[[1L]])
     where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 40: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 41: FUN(X[[i]], ...)
     where 42: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 43: force(code)
     where 44: doWithOneRestart(return(expr), restart)
     where 45: withOneRestart(expr, restarts[[1L]])
     where 46: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 47: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 48: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 49: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 50: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 51: test_check("SPOT")
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (x, AX, Ay, optimizeP = FALSE, useLambda = TRUE)
     {
     nx <- nrow(AX)
     theta <- 10^x[1:nx]
     if (optimizeP) {
     AX <- abs(AX)^(x[(nx + 1):(2 * nx)])
     }
     lambda <- 0
     if (useLambda)
     lambda <- 10^x[length(x)]
     if (any(theta == 0) || any(is.infinite(c(theta, lambda)))) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, ssq = NA))
     }
     n <- dim(Ay)[1]
     Psi <- exp(-matrix(colSums(theta * AX), n, n))
     if (useLambda)
     Psi <- Psi + diag(lambda, n)
     if (any(is.infinite(Psi))) {
     penalty <- 10000
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     kap <- rcond(Psi)
     if (is.na(kap))
     kap <- 0
     if (kap < 1e-10) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA, a = NA, U = NA, isIndefinite = TRUE))
     }
     cholPsi <- try(chol(Psi), TRUE)
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     LnDetPsi <- 2 * sum(log(abs(diag(cholPsi))))
     Psinv <- try(chol2inv(cholPsi), TRUE)
     if (class(Psinv) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     psisum <- sum(Psinv)
     if (psisum == 0) {
     psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
     if (psisum == 0) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     }
     mu <- sum(Psinv %*% Ay)/psisum
     if (is.infinite(mu) | is.na(mu)) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     yonemu <- Ay - mu
     SigmaSqr <- (t(yonemu) %*% Psinv %*% yonemu)/n
     if (SigmaSqr < 0) {
     return(list(NegLnLike = 10000 - SigmaSqr, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     NegLnLike <- n * log(SigmaSqr) + LnDetPsi
     if (is.na(NegLnLike) | is.infinite(NegLnLike))
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     list(NegLnLike = NegLnLike, Psi = Psi, Psinv = Psinv, mu = mu,
     yonemu = yonemu, ssq = SigmaSqr)
     }
     <bytecode: 0xbdc9a98>
     <environment: namespace:SPOT>
     --- function search by body ---
     Function krigingLikelihood in namespace SPOT has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 2. Error: check SPOT+NLOPTR with inequality constraints also in design (@test
     the condition has length > 1
     Backtrace:
     1. SPOT::spot(...)
     2. SPOT::spotLoop(...)
     3. control$model(x = x, y = y, control = control$modelControl)
     4. fit$algTheta(...)
     5. stats::optim(...)
     7. SPOT:::fn(par, ...)
     8. SPOT:::fun(matrix(x, 1), ...)
     9. base::apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     10. SPOT:::FUN(newX[, i], ...)
     11. SPOT::krigingLikelihood(x, fX, fy, optimizeP, useLambda)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     SPOT
     --- call from context ---
     krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     --- call from argument ---
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA, mu = NA,
     SSQ = NA))
     }
     --- R stacktrace ---
     where 1: krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     where 2: FUN(newX[, i], ...)
     where 3: apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     where 4: fun(matrix(x, 1), ...)
     where 5: fn(par, ...)
     where 6: (function (par)
     fn(par, ...))(c(0.0466666666666667, 0.0466666666666667, 0.0466666666666667,
     0))
     where 7: optim(par = x, fn = fn, lower = lower, upper = upper, control = control,
     method = "L-BFGS-B", ...)
     where 8: fit$algTheta(x = x0, fun = function(x, fX, fy, optimizeP, useLambda) {
     if (!is.matrix(x)) {
     fitFun(x, fX, fy, optimizeP, useLambda)
     }
     else {
     apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     }
     }, lower = LowerTheta, upper = UpperTheta, control = opts, fX = A,
     fy = fit$y, optimizeP = fit$optimizeP, useLambda = fit$useLambda)
     where 9: control$model(x = x, y = y, control = control$modelControl)
     where 10: spotLoop(x = x, y = y, fun = fun, lower = lower, upper = upper,
     control = control, ...)
     where 11 at testthat/test.initialInputCheck.ControlList.R#42: spot(x = xCorrect, fun = funSphere, lower = lCorrect, upper = uCorrect,
     control = c)
     where 12: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     where 13: withCallingHandlers({
     code
     NULL
     }, error = function(cnd) {
     if (can_entrace(cnd)) {
     cnd <- cnd_entrace(cnd)
     }
     return_from(env, cnd)
     })
     where 14: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)),
     ...)
     where 15: quasi_capture(enquo(object), label, capture_error, entrace = TRUE)
     where 16 at testthat/test.initialInputCheck.ControlList.R#41: expect_error({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect, upper = uCorrect,
     control = c)
     }, regexp = NA)
     where 17: eval(code, test_env)
     where 18: eval(code, test_env)
     where 19: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 20: doTryCatch(return(expr), name, parentenv, handler)
     where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 25: tryCatchList(expr, classes, parentenv, handlers)
     where 26: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 27: test_code(desc, code, env = parent.frame())
     where 28 at testthat/test.initialInputCheck.ControlList.R#3: test_that("Wrong Control Settings are blocked", {
     xCorrect <- matrix(1:12, ncol = 3)
     lCorrect <- c(-5, -5, -5)
     uCorrect <- c(15, 15, 15)
     errorControlLists <- list(list(funEvals = "50", designControl = list(size = 10)),
     list(funEvals = "50", designControl = list(size = 10,
     replicates = "B")), list(funEvals = 50, designControl = list(size = 10,
     replicates = "B")), list(funEvals = 50, designControl = list(size = 10,
     replicates = 10)), list(funEvals = 8), list(funEvals = 13),
     list(funEvals = 3, designControl = list(size = 1)))
     warningControlLists <- list(list(funEvals = 50 + 5 * 4, designControl = list(size = 10,
     replicates = 5)), list(funEvals = 50 + 4, designControl = list(size = 50)),
     list(funEvals = 14))
     goodControlLists <- list(list(funEvals <- 50, designControl <- list(size = 10,
     replicates = 3)), list(funEvals <- 8 + 4, designControl <- list(size = 7,
     replicates = 1)))
     for (c in goodControlLists) {
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uCorrect, control = c)
     }, regexp = NA)
     }
     for (c in warningControlLists) {
     expect_warning({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uCorrect, control = c)
     }, regexp = "SPOT Configuration Warning:")
     }
     for (c in errorControlLists) {
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uCorrect, control = c)
     }, regexp = "SPOT Configuration Error:")
     }
     })
     where 29: eval(code, test_env)
     where 30: eval(code, test_env)
     where 31: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 32: doTryCatch(return(expr), name, parentenv, handler)
     where 33: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 34: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 35: doTryCatch(return(expr), name, parentenv, handler)
     where 36: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 37: tryCatchList(expr, classes, parentenv, handlers)
     where 38: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 39: test_code(NULL, exprs, env)
     where 40: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 41: force(code)
     where 42: doWithOneRestart(return(expr), restart)
     where 43: withOneRestart(expr, restarts[[1L]])
     where 44: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 45: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 46: FUN(X[[i]], ...)
     where 47: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 48: force(code)
     where 49: doWithOneRestart(return(expr), restart)
     where 50: withOneRestart(expr, restarts[[1L]])
     where 51: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 52: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 53: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 54: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 55: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 56: test_check("SPOT")
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (x, AX, Ay, optimizeP = FALSE, useLambda = TRUE)
     {
     nx <- nrow(AX)
     theta <- 10^x[1:nx]
     if (optimizeP) {
     AX <- abs(AX)^(x[(nx + 1):(2 * nx)])
     }
     lambda <- 0
     if (useLambda)
     lambda <- 10^x[length(x)]
     if (any(theta == 0) || any(is.infinite(c(theta, lambda)))) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, ssq = NA))
     }
     n <- dim(Ay)[1]
     Psi <- exp(-matrix(colSums(theta * AX), n, n))
     if (useLambda)
     Psi <- Psi + diag(lambda, n)
     if (any(is.infinite(Psi))) {
     penalty <- 10000
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     kap <- rcond(Psi)
     if (is.na(kap))
     kap <- 0
     if (kap < 1e-10) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA, a = NA, U = NA, isIndefinite = TRUE))
     }
     cholPsi <- try(chol(Psi), TRUE)
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     LnDetPsi <- 2 * sum(log(abs(diag(cholPsi))))
     Psinv <- try(chol2inv(cholPsi), TRUE)
     if (class(Psinv) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     psisum <- sum(Psinv)
     if (psisum == 0) {
     psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
     if (psisum == 0) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     }
     mu <- sum(Psinv %*% Ay)/psisum
     if (is.infinite(mu) | is.na(mu)) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     yonemu <- Ay - mu
     SigmaSqr <- (t(yonemu) %*% Psinv %*% yonemu)/n
     if (SigmaSqr < 0) {
     return(list(NegLnLike = 10000 - SigmaSqr, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     NegLnLike <- n * log(SigmaSqr) + LnDetPsi
     if (is.na(NegLnLike) | is.infinite(NegLnLike))
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     list(NegLnLike = NegLnLike, Psi = Psi, Psinv = Psinv, mu = mu,
     yonemu = yonemu, ssq = SigmaSqr)
     }
     <bytecode: 0xbdc9a98>
     <environment: namespace:SPOT>
     --- function search by body ---
     Function krigingLikelihood in namespace SPOT has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 3. Failure: Wrong Control Settings are blocked (@test.initialInputCheck.Contr
     `{ ... }` threw an error.
     Message: the condition has length > 1
     Class: simpleError/error/condition
     Backtrace:
     1. testthat::expect_error(...)
     6. SPOT::spot(...)
     7. SPOT::spotLoop(...)
     8. control$model(x = x, y = y, control = control$modelControl)
     9. fit$algTheta(...)
     10. stats::optim(...)
     12. SPOT:::fn(par, ...)
     13. SPOT:::fun(matrix(x, 1), ...)
     14. base::apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     15. SPOT:::FUN(newX[, i], ...)
     16. SPOT::krigingLikelihood(x, fX, fy, optimizeP, useLambda)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     SPOT
     --- call from context ---
     krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     --- call from argument ---
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA, mu = NA,
     SSQ = NA))
     }
     --- R stacktrace ---
     where 1: krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     where 2: FUN(newX[, i], ...)
     where 3: apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     where 4: fun(matrix(x, 1), ...)
     where 5: fn(par, ...)
     where 6: (function (par)
     fn(par, ...))(c(0.0466666666666667, 0.0466666666666667, 0.0466666666666667,
     0))
     where 7: optim(par = x, fn = fn, lower = lower, upper = upper, control = control,
     method = "L-BFGS-B", ...)
     where 8: fit$algTheta(x = x0, fun = function(x, fX, fy, optimizeP, useLambda) {
     if (!is.matrix(x)) {
     fitFun(x, fX, fy, optimizeP, useLambda)
     }
     else {
     apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     }
     }, lower = LowerTheta, upper = UpperTheta, control = opts, fX = A,
     fy = fit$y, optimizeP = fit$optimizeP, useLambda = fit$useLambda)
     where 9: control$model(x = x, y = y, control = control$modelControl)
     where 10: spotLoop(x = x, y = y, fun = fun, lower = lower, upper = upper,
     control = control, ...)
     where 11 at testthat/test.initialInputCheck.ControlList.R#42: spot(x = xCorrect, fun = funSphere, lower = lCorrect, upper = uCorrect,
     control = c)
     where 12: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     where 13: withCallingHandlers({
     code
     NULL
     }, error = function(cnd) {
     if (can_entrace(cnd)) {
     cnd <- cnd_entrace(cnd)
     }
     return_from(env, cnd)
     })
     where 14: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)),
     ...)
     where 15: quasi_capture(enquo(object), label, capture_error, entrace = TRUE)
     where 16 at testthat/test.initialInputCheck.ControlList.R#41: expect_error({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect, upper = uCorrect,
     control = c)
     }, regexp = NA)
     where 17: eval(code, test_env)
     where 18: eval(code, test_env)
     where 19: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 20: doTryCatch(return(expr), name, parentenv, handler)
     where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 25: tryCatchList(expr, classes, parentenv, handlers)
     where 26: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 27: test_code(desc, code, env = parent.frame())
     where 28 at testthat/test.initialInputCheck.ControlList.R#3: test_that("Wrong Control Settings are blocked", {
     xCorrect <- matrix(1:12, ncol = 3)
     lCorrect <- c(-5, -5, -5)
     uCorrect <- c(15, 15, 15)
     errorControlLists <- list(list(funEvals = "50", designControl = list(size = 10)),
     list(funEvals = "50", designControl = list(size = 10,
     replicates = "B")), list(funEvals = 50, designControl = list(size = 10,
     replicates = "B")), list(funEvals = 50, designControl = list(size = 10,
     replicates = 10)), list(funEvals = 8), list(funEvals = 13),
     list(funEvals = 3, designControl = list(size = 1)))
     warningControlLists <- list(list(funEvals = 50 + 5 * 4, designControl = list(size = 10,
     replicates = 5)), list(funEvals = 50 + 4, designControl = list(size = 50)),
     list(funEvals = 14))
     goodControlLists <- list(list(funEvals <- 50, designControl <- list(size = 10,
     replicates = 3)), list(funEvals <- 8 + 4, designControl <- list(size = 7,
     replicates = 1)))
     for (c in goodControlLists) {
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uCorrect, control = c)
     }, regexp = NA)
     }
     for (c in warningControlLists) {
     expect_warning({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uCorrect, control = c)
     }, regexp = "SPOT Configuration Warning:")
     }
     for (c in errorControlLists) {
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uCorrect, control = c)
     }, regexp = "SPOT Configuration Error:")
     }
     })
     where 29: eval(code, test_env)
     where 30: eval(code, test_env)
     where 31: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 32: doTryCatch(return(expr), name, parentenv, handler)
     where 33: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 34: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 35: doTryCatch(return(expr), name, parentenv, handler)
     where 36: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 37: tryCatchList(expr, classes, parentenv, handlers)
     where 38: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 39: test_code(NULL, exprs, env)
     where 40: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 41: force(code)
     where 42: doWithOneRestart(return(expr), restart)
     where 43: withOneRestart(expr, restarts[[1L]])
     where 44: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 45: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 46: FUN(X[[i]], ...)
     where 47: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 48: force(code)
     where 49: doWithOneRestart(return(expr), restart)
     where 50: withOneRestart(expr, restarts[[1L]])
     where 51: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 52: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 53: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 54: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 55: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 56: test_check("SPOT")
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (x, AX, Ay, optimizeP = FALSE, useLambda = TRUE)
     {
     nx <- nrow(AX)
     theta <- 10^x[1:nx]
     if (optimizeP) {
     AX <- abs(AX)^(x[(nx + 1):(2 * nx)])
     }
     lambda <- 0
     if (useLambda)
     lambda <- 10^x[length(x)]
     if (any(theta == 0) || any(is.infinite(c(theta, lambda)))) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, ssq = NA))
     }
     n <- dim(Ay)[1]
     Psi <- exp(-matrix(colSums(theta * AX), n, n))
     if (useLambda)
     Psi <- Psi + diag(lambda, n)
     if (any(is.infinite(Psi))) {
     penalty <- 10000
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     kap <- rcond(Psi)
     if (is.na(kap))
     kap <- 0
     if (kap < 1e-10) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA, a = NA, U = NA, isIndefinite = TRUE))
     }
     cholPsi <- try(chol(Psi), TRUE)
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     LnDetPsi <- 2 * sum(log(abs(diag(cholPsi))))
     Psinv <- try(chol2inv(cholPsi), TRUE)
     if (class(Psinv) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     psisum <- sum(Psinv)
     if (psisum == 0) {
     psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
     if (psisum == 0) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     }
     mu <- sum(Psinv %*% Ay)/psisum
     if (is.infinite(mu) | is.na(mu)) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     yonemu <- Ay - mu
     SigmaSqr <- (t(yonemu) %*% Psinv %*% yonemu)/n
     if (SigmaSqr < 0) {
     return(list(NegLnLike = 10000 - SigmaSqr, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     NegLnLike <- n * log(SigmaSqr) + LnDetPsi
     if (is.na(NegLnLike) | is.infinite(NegLnLike))
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     list(NegLnLike = NegLnLike, Psi = Psi, Psinv = Psinv, mu = mu,
     yonemu = yonemu, ssq = SigmaSqr)
     }
     <bytecode: 0xbdc9a98>
     <environment: namespace:SPOT>
     --- function search by body ---
     Function krigingLikelihood in namespace SPOT has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 4. Failure: Wrong Control Settings are blocked (@test.initialInputCheck.Contr
     `{ ... }` threw an error.
     Message: the condition has length > 1
     Class: simpleError/error/condition
     Backtrace:
     1. testthat::expect_error(...)
     6. SPOT::spot(...)
     7. SPOT::spotLoop(...)
     8. control$model(x = x, y = y, control = control$modelControl)
     9. fit$algTheta(...)
     10. stats::optim(...)
     12. SPOT:::fn(par, ...)
     13. SPOT:::fun(matrix(x, 1), ...)
     14. base::apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     15. SPOT:::FUN(newX[, i], ...)
     16. SPOT::krigingLikelihood(x, fX, fy, optimizeP, useLambda)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     SPOT
     --- call from context ---
     krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     --- call from argument ---
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA, mu = NA,
     SSQ = NA))
     }
     --- R stacktrace ---
     where 1: krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     where 2: FUN(newX[, i], ...)
     where 3: apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     where 4: fun(matrix(x, 1), ...)
     where 5: fn(par, ...)
     where 6: (function (par)
     fn(par, ...))(c(0.05, 0.05, 0))
     where 7: optim(par = x, fn = fn, lower = lower, upper = upper, control = control,
     method = "L-BFGS-B", ...)
     where 8: fit$algTheta(x = x0, fun = function(x, fX, fy, optimizeP, useLambda) {
     if (!is.matrix(x)) {
     fitFun(x, fX, fy, optimizeP, useLambda)
     }
     else {
     apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     }
     }, lower = LowerTheta, upper = UpperTheta, control = opts, fX = A,
     fy = fit$y, optimizeP = fit$optimizeP, useLambda = fit$useLambda)
     where 9: control$model(x = x, y = y, control = control$modelControl)
     where 10: spotLoop(x = x, y = y, fun = fun, lower = lower, upper = upper,
     control = control, ...)
     where 11 at testthat/test.initialInputCheck.ControlList.R#68: spot(NULL, fun = funSphere, lower = c(0, 0), upper = c(5, 5),
     control = list(types = c("numeric", "num")))
     where 12: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     where 13: withCallingHandlers(code, warning = function(condition) {
     out$push(condition)
     maybe_restart("muffleWarning")
     })
     where 14: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)),
     ...)
     where 15: quasi_capture(enquo(object), label, capture_warnings)
     where 16 at testthat/test.initialInputCheck.ControlList.R#67: expect_warning({
     spot(NULL, fun = funSphere, lower = c(0, 0), upper = c(5,
     5), control = list(types = c("numeric", "num")))
     }, regexp = "SPOT Configuration Warning:")
     where 17: eval(code, test_env)
     where 18: eval(code, test_env)
     where 19: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 20: doTryCatch(return(expr), name, parentenv, handler)
     where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 25: tryCatchList(expr, classes, parentenv, handlers)
     where 26: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 27: test_code(desc, code, env = parent.frame())
     where 28 at testthat/test.initialInputCheck.ControlList.R#59: test_that("SPOT throws an error if control$types is configured wrong",
     {
     expect_error({
     spot(NULL, fun = funSphere, lower = c(0, 0), upper = c(5,
     5), control = list(types = c("numeric")))
     }, regexp = "SPOT Configuration Error:")
     expect_error({
     spot(NULL, fun = funSphere, lower = c(0, 0), upper = c(5,
     5), control = list(types = c("numeric", "numeric",
     "numeric")))
     }, regexp = "SPOT Configuration Error:")
     expect_warning({
     spot(NULL, fun = funSphere, lower = c(0, 0), upper = c(5,
     5), control = list(types = c("numeric", "num")))
     }, regexp = "SPOT Configuration Warning:")
     expect_warning({
     spot(NULL, fun = funSphere, lower = c(0, 0), upper = c(5,
     5), control = list(types = c("float", "numeric")))
     }, regexp = "SPOT Configuration Warning:")
     expect_warning({
     spot(NULL, fun = funSphere, lower = c(0, 0), upper = c(5,
     5), control = list(types = c("numeric", 88)))
     }, regexp = "SPOT Configuration Warning:")
     })
     where 29: eval(code, test_env)
     where 30: eval(code, test_env)
     where 31: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 32: doTryCatch(return(expr), name, parentenv, handler)
     where 33: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 34: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 35: doTryCatch(return(expr), name, parentenv, handler)
     where 36: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 37: tryCatchList(expr, classes, parentenv, handlers)
     where 38: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 39: test_code(NULL, exprs, env)
     where 40: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 41: force(code)
     where 42: doWithOneRestart(return(expr), restart)
     where 43: withOneRestart(expr, restarts[[1L]])
     where 44: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 45: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 46: FUN(X[[i]], ...)
     where 47: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 48: force(code)
     where 49: doWithOneRestart(return(expr), restart)
     where 50: withOneRestart(expr, restarts[[1L]])
     where 51: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 52: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 53: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 54: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 55: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 56: test_check("SPOT")
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (x, AX, Ay, optimizeP = FALSE, useLambda = TRUE)
     {
     nx <- nrow(AX)
     theta <- 10^x[1:nx]
     if (optimizeP) {
     AX <- abs(AX)^(x[(nx + 1):(2 * nx)])
     }
     lambda <- 0
     if (useLambda)
     lambda <- 10^x[length(x)]
     if (any(theta == 0) || any(is.infinite(c(theta, lambda)))) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, ssq = NA))
     }
     n <- dim(Ay)[1]
     Psi <- exp(-matrix(colSums(theta * AX), n, n))
     if (useLambda)
     Psi <- Psi + diag(lambda, n)
     if (any(is.infinite(Psi))) {
     penalty <- 10000
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     kap <- rcond(Psi)
     if (is.na(kap))
     kap <- 0
     if (kap < 1e-10) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA, a = NA, U = NA, isIndefinite = TRUE))
     }
     cholPsi <- try(chol(Psi), TRUE)
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     LnDetPsi <- 2 * sum(log(abs(diag(cholPsi))))
     Psinv <- try(chol2inv(cholPsi), TRUE)
     if (class(Psinv) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     psisum <- sum(Psinv)
     if (psisum == 0) {
     psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
     if (psisum == 0) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     }
     mu <- sum(Psinv %*% Ay)/psisum
     if (is.infinite(mu) | is.na(mu)) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     yonemu <- Ay - mu
     SigmaSqr <- (t(yonemu) %*% Psinv %*% yonemu)/n
     if (SigmaSqr < 0) {
     return(list(NegLnLike = 10000 - SigmaSqr, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     NegLnLike <- n * log(SigmaSqr) + LnDetPsi
     if (is.na(NegLnLike) | is.infinite(NegLnLike))
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     list(NegLnLike = NegLnLike, Psi = Psi, Psinv = Psinv, mu = mu,
     yonemu = yonemu, ssq = SigmaSqr)
     }
     <bytecode: 0xbdc9a98>
     <environment: namespace:SPOT>
     --- function search by body ---
     Function krigingLikelihood in namespace SPOT has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 5. Error: SPOT throws an error if control$types is configured wrong (@test.in
     the condition has length > 1
     Backtrace:
     1. testthat::expect_warning(...)
     6. SPOT::spot(...)
     7. SPOT::spotLoop(...)
     8. control$model(x = x, y = y, control = control$modelControl)
     9. fit$algTheta(...)
     10. stats::optim(...)
     12. SPOT:::fn(par, ...)
     13. SPOT:::fun(matrix(x, 1), ...)
     14. base::apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     15. SPOT:::FUN(newX[, i], ...)
     16. SPOT::krigingLikelihood(x, fX, fy, optimizeP, useLambda)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     SPOT
     --- call from context ---
     krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     --- call from argument ---
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA, mu = NA,
     SSQ = NA))
     }
     --- R stacktrace ---
     where 1: krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     where 2: FUN(newX[, i], ...)
     where 3: apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     where 4: fun(matrix(x, 1), ...)
     where 5: fn(par, ...)
     where 6: (function (par)
     fn(par, ...))(c(0.0466666666666667, 0.0466666666666667, 0.0466666666666667,
     0))
     where 7: optim(par = x, fn = fn, lower = lower, upper = upper, control = control,
     method = "L-BFGS-B", ...)
     where 8: fit$algTheta(x = x0, fun = function(x, fX, fy, optimizeP, useLambda) {
     if (!is.matrix(x)) {
     fitFun(x, fX, fy, optimizeP, useLambda)
     }
     else {
     apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     }
     }, lower = LowerTheta, upper = UpperTheta, control = opts, fX = A,
     fy = fit$y, optimizeP = fit$optimizeP, useLambda = fit$useLambda)
     where 9: control$model(x = x, y = y, control = control$modelControl)
     where 10: spotLoop(x = x, y = y, fun = fun, lower = lower, upper = upper,
     control = control, ...)
     where 11 at testthat/test.initialInputCheck.ControlList.R#96: spot(x = xCorrect, fun = funSphere, lower = lCorrect, upper = uCorrect,
     control = controlLists[[i]])
     where 12: eval_bare(expr, quo_get_env(quo))
     where 13: quasi_label(enquo(object), label, arg = "object")
     where 14 at testthat/test.initialInputCheck.ControlList.R#95: expect_equal({
     length(spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uCorrect, control = controlLists[[i]])$y)
     }, expectedLengths[i])
     where 15: eval(code, test_env)
     where 16: eval(code, test_env)
     where 17: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 18: doTryCatch(return(expr), name, parentenv, handler)
     where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 21: doTryCatch(return(expr), name, parentenv, handler)
     where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 23: tryCatchList(expr, classes, parentenv, handlers)
     where 24: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 25: test_code(desc, code, env = parent.frame())
     where 26 at testthat/test.initialInputCheck.ControlList.R#78: test_that("SPOT uses the correct amount of function evaluations",
     {
     xCorrect <- matrix(1:12, ncol = 3)
     lCorrect <- c(-5, -5, -5)
     uCorrect <- c(15, 15, 15)
     controlLists <- list(NULL, list(), list(funEvals = 23),
     list(funEvals = 15, designControl = list(size = 10)),
     list(funEvals = 15), list(funEvals = 9, designControl = list(size = 4)),
     list(funEvals = 6, designControl = list(size = 1)))
     expectedLengths <- c(20, 20, 23, 15, 15, 9, 6)
     for (i in seq_along(controlLists)) {
     expect_equal({
     length(spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uCorrect, control = controlLists[[i]])$y)
     }, expectedLengths[i])
     }
     })
     where 27: eval(code, test_env)
     where 28: eval(code, test_env)
     where 29: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 30: doTryCatch(return(expr), name, parentenv, handler)
     where 31: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 32: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 33: doTryCatch(return(expr), name, parentenv, handler)
     where 34: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 35: tryCatchList(expr, classes, parentenv, handlers)
     where 36: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 37: test_code(NULL, exprs, env)
     where 38: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 44: FUN(X[[i]], ...)
     where 45: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 46: force(code)
     where 47: doWithOneRestart(return(expr), restart)
     where 48: withOneRestart(expr, restarts[[1L]])
     where 49: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 50: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 51: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 52: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 53: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 54: test_check("SPOT")
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (x, AX, Ay, optimizeP = FALSE, useLambda = TRUE)
     {
     nx <- nrow(AX)
     theta <- 10^x[1:nx]
     if (optimizeP) {
     AX <- abs(AX)^(x[(nx + 1):(2 * nx)])
     }
     lambda <- 0
     if (useLambda)
     lambda <- 10^x[length(x)]
     if (any(theta == 0) || any(is.infinite(c(theta, lambda)))) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, ssq = NA))
     }
     n <- dim(Ay)[1]
     Psi <- exp(-matrix(colSums(theta * AX), n, n))
     if (useLambda)
     Psi <- Psi + diag(lambda, n)
     if (any(is.infinite(Psi))) {
     penalty <- 10000
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     kap <- rcond(Psi)
     if (is.na(kap))
     kap <- 0
     if (kap < 1e-10) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA, a = NA, U = NA, isIndefinite = TRUE))
     }
     cholPsi <- try(chol(Psi), TRUE)
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     LnDetPsi <- 2 * sum(log(abs(diag(cholPsi))))
     Psinv <- try(chol2inv(cholPsi), TRUE)
     if (class(Psinv) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     psisum <- sum(Psinv)
     if (psisum == 0) {
     psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
     if (psisum == 0) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     }
     mu <- sum(Psinv %*% Ay)/psisum
     if (is.infinite(mu) | is.na(mu)) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     yonemu <- Ay - mu
     SigmaSqr <- (t(yonemu) %*% Psinv %*% yonemu)/n
     if (SigmaSqr < 0) {
     return(list(NegLnLike = 10000 - SigmaSqr, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     NegLnLike <- n * log(SigmaSqr) + LnDetPsi
     if (is.na(NegLnLike) | is.infinite(NegLnLike))
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     list(NegLnLike = NegLnLike, Psi = Psi, Psinv = Psinv, mu = mu,
     yonemu = yonemu, ssq = SigmaSqr)
     }
     <bytecode: 0xbdc9a98>
     <environment: namespace:SPOT>
     --- function search by body ---
     Function krigingLikelihood in namespace SPOT has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 6. Error: SPOT uses the correct amount of function evaluations (@test.initial
     the condition has length > 1
     Backtrace:
     1. testthat::expect_equal(...)
     4. SPOT::spot(...)
     5. SPOT::spotLoop(...)
     6. control$model(x = x, y = y, control = control$modelControl)
     7. fit$algTheta(...)
     8. stats::optim(...)
     10. SPOT:::fn(par, ...)
     11. SPOT:::fun(matrix(x, 1), ...)
     12. base::apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     13. SPOT:::FUN(newX[, i], ...)
     14. SPOT::krigingLikelihood(x, fX, fy, optimizeP, useLambda)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     SPOT
     --- call from context ---
     krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     --- call from argument ---
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA, mu = NA,
     SSQ = NA))
     }
     --- R stacktrace ---
     where 1: krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     where 2: FUN(newX[, i], ...)
     where 3: apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     where 4: fun(matrix(x, 1), ...)
     where 5: fn(par, ...)
     where 6: (function (par)
     fn(par, ...))(c(0.0466666666666667, 0.0466666666666667, 0.0466666666666667,
     0))
     where 7: optim(par = x, fn = fn, lower = lower, upper = upper, control = control,
     method = "L-BFGS-B", ...)
     where 8: fit$algTheta(x = x0, fun = function(x, fX, fy, optimizeP, useLambda) {
     if (!is.matrix(x)) {
     fitFun(x, fX, fy, optimizeP, useLambda)
     }
     else {
     apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     }
     }, lower = LowerTheta, upper = UpperTheta, control = opts, fX = A,
     fy = fit$y, optimizeP = fit$optimizeP, useLambda = fit$useLambda)
     where 9: control$model(x = x, y = y, control = control$modelControl)
     where 10: spotLoop(x = x, y = y, fun = fun, lower = lower, upper = upper,
     control = control, ...)
     where 11 at testthat/test.initialInputCheck.xLowerUpper.R#31: spot(x = xCorrect, fun = funSphere, lower = lWrongs[[l]], upper = uCorrect)
     where 12: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     where 13: withCallingHandlers(code, warning = function(condition) {
     out$push(condition)
     maybe_restart("muffleWarning")
     })
     where 14: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)),
     ...)
     where 15: quasi_capture(enquo(object), label, capture_warnings)
     where 16 at testthat/test.initialInputCheck.xLowerUpper.R#30: expect_warning({
     spot(x = xCorrect, fun = funSphere, lower = lWrongs[[l]],
     upper = uCorrect)
     }, regexp = "SPOT Configuration Warning:")
     where 17: eval(code, test_env)
     where 18: eval(code, test_env)
     where 19: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 20: doTryCatch(return(expr), name, parentenv, handler)
     where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 25: tryCatchList(expr, classes, parentenv, handlers)
     where 26: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 27: test_code(desc, code, env = parent.frame())
     where 28 at testthat/test.initialInputCheck.xLowerUpper.R#4: test_that("Check conditions with wrong input dimensions", {
     xCorrect <- matrix(1:12, ncol = 3)
     lCorrect <- c(-5, -5, -5)
     uCorrect <- c(15, 15, 15)
     warning <- 1
     error <- 2
     lWrongs <- list(c(-5, -5), c(20, 20, 20), c(20, 20), c(-5,
     -5, -5, -5))
     lWrongs.expected <- c(error, warning, error, error)
     uWrongs <- list(c(15, 15), c(-6, -6, -6), c(-5, -5), c(15,
     15, 15, 15))
     uWrongs.expected <- c(error, warning, error, error)
     xWrongs <- list(matrix(1:12, ncol = 2), matrix(c(1:11, NA),
     ncol = 3), matrix(1:12, ncol = 4))
     xWrongs.expected <- c(error, error, error)
     for (l in seq_along(lWrongs)) {
     expected <- lWrongs.expected[l]
     if (expected == warning) {
     expect_warning({
     spot(x = xCorrect, fun = funSphere, lower = lWrongs[[l]],
     upper = uCorrect)
     }, regexp = "SPOT Configuration Warning:")
     }
     else {
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = lWrongs[[l]],
     upper = uCorrect)
     }, regexp = "SPOT Configuration Error:")
     }
     }
     for (u in seq_along(uWrongs)) {
     expected <- uWrongs.expected[u]
     if (expected == warning) {
     expect_warning({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uWrongs[[u]])
     }, regexp = "SPOT Configuration Warning:")
     }
     else {
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = lCorrect,
     upper = uWrongs[[u]])
     }, regexp = "SPOT Configuration Error:")
     }
     }
     for (l in seq_along(lWrongs)) {
     for (u in seq_along(uWrongs)) {
     expected <- max(lWrongs.expected[[l]], uWrongs.expected[[u]])
     if (expected == warning) {
     expect_warning({
     spot(x = xCorrect, fun = funSphere, lower = lWrongs[[l]],
     upper = uWrongs[[u]])
     })
     }
     else {
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = lWrongs[[l]],
     upper = uWrongs[[u]])
     }, regexp = "SPOT Configuration Error:")
     }
     }
     }
     for (xW in seq_along(xWrongs)) {
     expected <- xWrongs.expected[[xW]]
     if (expected == warning) {
     expect_warning({
     spot(x = xWrongs[[xW]], fun = funSphere, lower = lCorrect,
     upper = uCorrect)
     }, regexp = "SPOT Configuration Warning:")
     }
     else {
     expect_error({
     spot(x = xWrongs[[xW]], fun = funSphere, lower = lCorrect,
     upper = uCorrect)
     }, regexp = "SPOT Configuration Error:")
     }
     }
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = c(5, 5, 5),
     upper = c(5, 5, 5))
     }, regexp = "SPOT Configuration Error:")
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = c(1, 8, 2.6),
     upper = c(11, 8, 17.4))
     }, regexp = "SPOT Configuration Error:")
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = c(12, 1,
     2), upper = c(12, 4, 5))
     }, regexp = "SPOT Configuration Error:")
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = c(5, NA,
     5), upper = c(5, 5, 5))
     }, regexp = "SPOT Configuration Error:")
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = c(5, 5, 5),
     upper = c(NA, NA, NA))
     }, regexp = "SPOT Configuration Error:")
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = c(5, "someString",
     5), upper = c(5, 5, 5))
     }, regexp = "SPOT Configuration Error:")
     expect_error({
     spot(x = xCorrect, fun = funSphere, lower = c(5, 5, 5),
     upper = c("Cause", "an", "Error"))
     }, regexp = "SPOT Configuration Error:")
     })
     where 29: eval(code, test_env)
     where 30: eval(code, test_env)
     where 31: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 32: doTryCatch(return(expr), name, parentenv, handler)
     where 33: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 34: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 35: doTryCatch(return(expr), name, parentenv, handler)
     where 36: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 37: tryCatchList(expr, classes, parentenv, handlers)
     where 38: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 39: test_code(NULL, exprs, env)
     where 40: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 41: force(code)
     where 42: doWithOneRestart(return(expr), restart)
     where 43: withOneRestart(expr, restarts[[1L]])
     where 44: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 45: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 46: FUN(X[[i]], ...)
     where 47: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 48: force(code)
     where 49: doWithOneRestart(return(expr), restart)
     where 50: withOneRestart(expr, restarts[[1L]])
     where 51: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 52: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 53: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 54: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 55: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 56: test_check("SPOT")
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (x, AX, Ay, optimizeP = FALSE, useLambda = TRUE)
     {
     nx <- nrow(AX)
     theta <- 10^x[1:nx]
     if (optimizeP) {
     AX <- abs(AX)^(x[(nx + 1):(2 * nx)])
     }
     lambda <- 0
     if (useLambda)
     lambda <- 10^x[length(x)]
     if (any(theta == 0) || any(is.infinite(c(theta, lambda)))) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, ssq = NA))
     }
     n <- dim(Ay)[1]
     Psi <- exp(-matrix(colSums(theta * AX), n, n))
     if (useLambda)
     Psi <- Psi + diag(lambda, n)
     if (any(is.infinite(Psi))) {
     penalty <- 10000
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     kap <- rcond(Psi)
     if (is.na(kap))
     kap <- 0
     if (kap < 1e-10) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA, a = NA, U = NA, isIndefinite = TRUE))
     }
     cholPsi <- try(chol(Psi), TRUE)
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     LnDetPsi <- 2 * sum(log(abs(diag(cholPsi))))
     Psinv <- try(chol2inv(cholPsi), TRUE)
     if (class(Psinv) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     psisum <- sum(Psinv)
     if (psisum == 0) {
     psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
     if (psisum == 0) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     }
     mu <- sum(Psinv %*% Ay)/psisum
     if (is.infinite(mu) | is.na(mu)) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     yonemu <- Ay - mu
     SigmaSqr <- (t(yonemu) %*% Psinv %*% yonemu)/n
     if (SigmaSqr < 0) {
     return(list(NegLnLike = 10000 - SigmaSqr, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     NegLnLike <- n * log(SigmaSqr) + LnDetPsi
     if (is.na(NegLnLike) | is.infinite(NegLnLike))
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     list(NegLnLike = NegLnLike, Psi = Psi, Psinv = Psinv, mu = mu,
     yonemu = yonemu, ssq = SigmaSqr)
     }
     <bytecode: 0xbdc9a98>
     <environment: namespace:SPOT>
     --- function search by body ---
     Function krigingLikelihood in namespace SPOT has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 7. Error: Check conditions with wrong input dimensions (@test.initialInputChe
     the condition has length > 1
     Backtrace:
     1. testthat::expect_warning(...)
     6. SPOT::spot(...)
     7. SPOT::spotLoop(...)
     8. control$model(x = x, y = y, control = control$modelControl)
     9. fit$algTheta(...)
     10. stats::optim(...)
     12. SPOT:::fn(par, ...)
     13. SPOT:::fun(matrix(x, 1), ...)
     14. base::apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     15. SPOT:::FUN(newX[, i], ...)
     16. SPOT::krigingLikelihood(x, fX, fy, optimizeP, useLambda)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     SPOT
     --- call from context ---
     krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     --- call from argument ---
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA, mu = NA,
     SSQ = NA))
     }
     --- R stacktrace ---
     where 1: krigingLikelihood(x, fX, fy, optimizeP, useLambda)
     where 2: FUN(newX[, i], ...)
     where 3: apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     where 4: fun(matrix(x, 1), ...)
     where 5: fn(par, ...)
     where 6: (function (par)
     fn(par, ...))(c(0.05, 0.05, 0))
     where 7: optim(par = x, fn = fn, lower = lower, upper = upper, control = control,
     method = "L-BFGS-B", ...)
     where 8: fit$algTheta(x = x0, fun = function(x, fX, fy, optimizeP, useLambda) {
     if (!is.matrix(x)) {
     fitFun(x, fX, fy, optimizeP, useLambda)
     }
     else {
     apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     }
     }, lower = LowerTheta, upper = UpperTheta, control = opts, fX = A,
     fy = fit$y, optimizeP = fit$optimizeP, useLambda = fit$useLambda)
     where 9: control$model(x = x, y = y, control = control$modelControl)
     where 10: spotLoop(x = x, y = y, fun = fun, lower = lower, upper = upper,
     control = control, ...)
     where 11 at testthat/test.main.R#5: spot(, funSphere, c(-2, -3), c(1, 2))
     where 12: eval(code, test_env)
     where 13: eval(code, test_env)
     where 14: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 15: doTryCatch(return(expr), name, parentenv, handler)
     where 16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 17: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 18: doTryCatch(return(expr), name, parentenv, handler)
     where 19: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 20: tryCatchList(expr, classes, parentenv, handlers)
     where 21: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 22: test_code(desc, code, env = parent.frame())
     where 23 at testthat/test.main.R#4: test_that("check that spot function works without problems",
     {
     res <- spot(, funSphere, c(-2, -3), c(1, 2))
     expect_equal(c(nrow(res$x), length(res$y)), c(20, 20))
     res <- spot(, funSphere, c(-2, -3), c(1, 2), control = list(model = buildLM))
     expect_equal(c(nrow(res$x), length(res$y)), c(20, 20))
     res <- spot(, funSphere, c(-2, -3), c(1, 2), control = list(funEvals = 11,
     model = buildKrigingDACE))
     expect_equal(c(nrow(res$x), length(res$y)), c(11, 11))
     res <- spot(, funSphere, c(-2, -3), c(1, 2), control = list(optimizer = optimLBFGSB))
     expect_equal(c(nrow(res$x), length(res$y)), c(20, 20))
     res <- spot(, funSphere, c(-2, -3), c(1, 2), control = list(design = designUniformRandom))
     expect_equal(c(nrow(res$x), length(res$y)), c(20, 20))
     res <- spot(, funSphere, c(-2, -3), c(1, 2), control = list(modelControl = list(target = "ei")))
     expect_equal(c(nrow(res$x), length(res$y)), c(20, 20))
     })
     where 24: eval(code, test_env)
     where 25: eval(code, test_env)
     where 26: withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error)
     where 27: doTryCatch(return(expr), name, parentenv, handler)
     where 28: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 29: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 30: doTryCatch(return(expr), name, parentenv, handler)
     where 31: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 32: tryCatchList(expr, classes, parentenv, handlers)
     where 33: tryCatch(withCallingHandlers({
     eval(code, test_env)
     if (!handled && !is.null(test)) {
     skip_empty()
     }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,
     message = handle_message, error = handle_error), error = handle_fatal,
     skip = function(e) {
     })
     where 34: test_code(NULL, exprs, env)
     where 35: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 36: force(code)
     where 37: doWithOneRestart(return(expr), restart)
     where 38: withOneRestart(expr, restarts[[1L]])
     where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 40: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,
     {
     reporter$start_file(basename(path))
     lister$start_file(basename(path))
     source_file(path, new.env(parent = env), chdir = TRUE,
     wrap = wrap)
     reporter$.end_context()
     reporter$end_file()
     })
     where 41: FUN(X[[i]], ...)
     where 42: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 43: force(code)
     where 44: doWithOneRestart(return(expr), restart)
     where 45: withOneRestart(expr, restarts[[1L]])
     where 46: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 47: with_reporter(reporter = current_reporter, results <- lapply(paths,
     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,
     load_helpers = FALSE, wrap = wrap))
     where 48: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 49: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,
     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,
     wrap = wrap)
     where 50: test_package_dir(package = package, test_path = test_path, filter = filter,
     reporter = reporter, ..., stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 51: test_check("SPOT")
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (x, AX, Ay, optimizeP = FALSE, useLambda = TRUE)
     {
     nx <- nrow(AX)
     theta <- 10^x[1:nx]
     if (optimizeP) {
     AX <- abs(AX)^(x[(nx + 1):(2 * nx)])
     }
     lambda <- 0
     if (useLambda)
     lambda <- 10^x[length(x)]
     if (any(theta == 0) || any(is.infinite(c(theta, lambda)))) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, ssq = NA))
     }
     n <- dim(Ay)[1]
     Psi <- exp(-matrix(colSums(theta * AX), n, n))
     if (useLambda)
     Psi <- Psi + diag(lambda, n)
     if (any(is.infinite(Psi))) {
     penalty <- 10000
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     kap <- rcond(Psi)
     if (is.na(kap))
     kap <- 0
     if (kap < 1e-10) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA, a = NA, U = NA, isIndefinite = TRUE))
     }
     cholPsi <- try(chol(Psi), TRUE)
     if (class(cholPsi) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     LnDetPsi <- 2 * sum(log(abs(diag(cholPsi))))
     Psinv <- try(chol2inv(cholPsi), TRUE)
     if (class(Psinv) == "try-error") {
     penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
     return(list(NegLnLike = penalty, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     psisum <- sum(Psinv)
     if (psisum == 0) {
     psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
     if (psisum == 0) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     }
     mu <- sum(Psinv %*% Ay)/psisum
     if (is.infinite(mu) | is.na(mu)) {
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     yonemu <- Ay - mu
     SigmaSqr <- (t(yonemu) %*% Psinv %*% yonemu)/n
     if (SigmaSqr < 0) {
     return(list(NegLnLike = 10000 - SigmaSqr, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     }
     NegLnLike <- n * log(SigmaSqr) + LnDetPsi
     if (is.na(NegLnLike) | is.infinite(NegLnLike))
     return(list(NegLnLike = 10000, Psi = NA, Psinv = NA,
     mu = NA, SSQ = NA))
     list(NegLnLike = NegLnLike, Psi = Psi, Psinv = Psinv, mu = mu,
     yonemu = yonemu, ssq = SigmaSqr)
     }
     <bytecode: 0xbdc9a98>
     <environment: namespace:SPOT>
     --- function search by body ---
     Function krigingLikelihood in namespace SPOT has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 8. Error: check that spot function works without problems (@test.main.R#5) -
     the condition has length > 1
     Backtrace:
     1. SPOT::spot(, funSphere, c(-2, -3), c(1, 2))
     2. SPOT::spotLoop(...)
     3. control$model(x = x, y = y, control = control$modelControl)
     4. fit$algTheta(...)
     5. stats::optim(...)
     7. SPOT:::fn(par, ...)
     8. SPOT:::fun(matrix(x, 1), ...)
     9. base::apply(x, 1, fitFun, fX, fy, optimizeP, useLambda)
     10. SPOT:::FUN(newX[, i], ...)
     11. SPOT::krigingLikelihood(x, fX, fy, optimizeP, useLambda)
    
     == testthat results ===========================================================
     [ OK: 28 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 8 ]
     1. Error: check SPOT+NLOPTR with inequality constraints but with default design (@test.inequalityConstraint.R#32)
     2. Error: check SPOT+NLOPTR with inequality constraints also in design (@test.inequalityConstraint.R#52)
     3. Failure: Wrong Control Settings are blocked (@test.initialInputCheck.ControlList.R#41)
     4. Failure: Wrong Control Settings are blocked (@test.initialInputCheck.ControlList.R#41)
     5. Error: SPOT throws an error if control$types is configured wrong (@test.initialInputCheck.ControlList.R#67)
     6. Error: SPOT uses the correct amount of function evaluations (@test.initialInputCheck.ControlList.R#95)
     7. Error: Check conditions with wrong input dimensions (@test.initialInputCheck.xLowerUpper.R#30)
     8. Error: check that spot function works without problems (@test.main.R#5)
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-devel-linux-x86_64-debian-clang