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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: createSimulatedTestFunction
> ### Title: Simulation-based Test Function Generator, Object Interface
> ### Aliases: createSimulatedTestFunction
> 
> ### ** Examples
> 
> nsim <- 10
> seed <- 12345
> n <- 6
> set.seed(seed)
> #target function:
> fun <- function(x){
+   exp(-20* x) + sin(6*x^2) + x
+ }
> # "vectorize" target
> f <- function(x){sapply(x,fun)}
> # distance function
> dF <- function(x,y)(sum((x-y)^2)) #sum of squares 
> #start pdf creation
> # plot params
> par(mfrow=c(4,1),mar=c(2.3,2.5,0.2,0.2),mgp=c(1.4,0.5,0))
> #test samples for plots
> xtest <- as.list(seq(from=-0,by=0.005,to=1))
> plot(xtest,f(xtest),type="l",xlab="x",ylab="Obj. function")
> #evaluation samples (training)
> xb <- as.list(runif(n)) 
> yb <- f(xb)
> # support samples for simulation
> x <- as.list(sort(c(runif(100),unlist(xb))))
> # fit the model	
> fit <- modelKriging(xb,yb,dF,control=list(
+    algThetaControl=list(method="NLOPT_GN_DIRECT_L",funEvals=100),useLambda=FALSE))
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
CEGO
 --- call from context --- 
eval_f(x0, ...)
 --- call from argument --- 
if (class(cholPsi) == "try-error") {
    penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, only.values = TRUE)$values)
    if (returnLikelihoodOnly) {
        return(penalty)
    }
    return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
        unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, SSQ = NA, 
        a = NA, U = NA, isIndefinite = isIndefinite))
}
 --- R stacktrace ---
where 1: eval_f(x0, ...)
where 2: nloptr::nloptr(x, fun, lb = lower, ub = upper, eval_g_ineq = control$ineq_constr, 
    opts = opts, ...)
where 3: control$algTheta(x = x0, fun = modelKrigingLikelihood, lower = lower, 
    upper = upper, control = algThetaControl, D = D, y = fit$y, 
    useLambda = useLambda, corr = fcorr, indefiniteMethod = indefiniteMethod, 
    indefiniteType = indefiniteType, indefiniteRepair = indefiniteRepair, 
    returnLikelihoodOnly = TRUE, inverter = "chol", ntheta = ntheta)
where 4: modelKriging(xb, yb, dF, control = list(algThetaControl = list(method = "NLOPT_GN_DIRECT_L", 
    funEvals = 100), useLambda = FALSE))

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (xt, D, y, useLambda = FALSE, corr = fcorrGauss, indefiniteMethod = "none", 
    indefiniteType = "PSD", indefiniteRepair = FALSE, returnLikelihoodOnly = TRUE, 
    inverter = "chol", ntheta = 1) 
{
    n <- dim(y)[1]
    isIndefinite <- NA
    if (is.list(D)) {
        distanceWeights <- 10^xt[ntheta + (1:length(D))]
        D <- Reduce("+", mapply("*", D, distanceWeights, SIMPLIFY = FALSE))
        origD <- D
        ret <- correctionDistanceMatrix(D, indefiniteType, indefiniteMethod, 
            indefiniteRepair)
        D <- ret$mat
        isCNSD <- ret$isCNSD
        A <- ret$A
    }
    if (ntheta < 1) {
        Psi <- corr(D)
    }
    else {
        theta <- xt[1:ntheta]
        Psi <- corr(D, theta)
    }
    if (any(is.infinite(Psi))) {
        penalty <- 10000
        if (returnLikelihoodOnly) {
            return(penalty)
        }
        return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
            unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
            SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
    }
    U <- a <- NA
    origPsi <- NA
    unrepairedPsi <- NA
    if (indefiniteType == "PSD") {
        origPsi <- Psi
        ret <- correctionKernelMatrix(Psi, indefiniteMethod, 
            indefiniteRepair)
        a <- ret$a
        U <- ret$U
        isIndefinite <- !ret$isPSD
        Psi <- ret$mat
        unrepairedPsi <- ret$matNoRep
        if (any(is.na(Psi))) {
            penalty <- 10000
            if (returnLikelihoodOnly) {
                return(penalty)
            }
            return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
                unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
                SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
        }
    }
    if (useLambda) {
        lambda <- 10^xt[length(xt)]
        Psi <- Psi + diag(lambda, n)
    }
    if (inverter == "chol") {
        cholPsi <- try(chol(Psi), TRUE)
        if (class(cholPsi) == "try-error") {
            penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, 
                only.values = TRUE)$values)
            if (returnLikelihoodOnly) {
                return(penalty)
            }
            return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
                unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
                SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
        }
        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)
            if (returnLikelihoodOnly) {
                return(penalty)
            }
            return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
                unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
                SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
        }
    }
    else {
        Psinv <- try(solve(Psi), TRUE)
        if (class(Psinv) == "try-error") {
            penalty <- 10000 - min(eigen(Psi, symmetric = TRUE, 
                only.values = TRUE)$values)
            if (returnLikelihoodOnly) {
                return(penalty)
            }
            return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
                unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
                SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
        }
        LnDetPsi <- determinant(Psi, logarithm = TRUE)$modulus
    }
    kap <- 1/(max(colSums(abs(Psi))) * max(colSums(abs(Psinv))))
    if (is.na(kap)) 
        kap <- 0
    if (kap < 1e-10) {
        penalty <- 10000
        if (returnLikelihoodOnly) {
            return(penalty)
        }
        return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
            unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
            SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
    }
    psisum <- sum(Psinv)
    if (psisum == 0) {
        psisum <- as.numeric(rep(1, n) %*% Psinv %*% rep(1, n))
        if (psisum == 0) {
            penalty <- 10000
            if (returnLikelihoodOnly) {
                return(penalty)
            }
            return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
                unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
                SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
        }
    }
    mu <- sum(Psinv %*% y)/psisum
    if (is.infinite(mu) | is.na(mu)) {
        penalty <- 10000
        if (returnLikelihoodOnly) {
            return(penalty)
        }
        return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
            unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
            SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
    }
    yMu <- y - mu
    SigmaSqr <- crossprod(yMu, Psinv) %*% yMu/n
    if (SigmaSqr < 0) {
        penalty <- as.numeric(10000 - SigmaSqr)
        if (returnLikelihoodOnly) {
            return(penalty)
        }
        return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
            unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
            SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
    }
    NegLnLike <- n * log(SigmaSqr) + LnDetPsi
    if (is.na(NegLnLike) | is.infinite(NegLnLike)) {
        penalty <- 10000
        if (returnLikelihoodOnly) {
            return(penalty)
        }
        return(list(NegLnLike = penalty, origPsi = NA, Psi = NA, 
            unrepairedPsi = NA, Psinv = NA, mu = NA, yMu = NA, 
            SSQ = NA, a = NA, U = NA, isIndefinite = isIndefinite))
    }
    if (returnLikelihoodOnly) {
        return(as.numeric(NegLnLike))
    }
    ret <- list(NegLnLike = NegLnLike, origPsi = origPsi, Psi = Psi, 
        unrepairedPsi = unrepairedPsi, Psinv = Psinv, mu = mu, 
        yMu = yMu, SSQ = SigmaSqr, a = a, U = U, isIndefinite = isIndefinite)
    if (exists("origD")) {
        ret$D <- D
        ret$origD <- origD
        ret$isCNSD <- isCNSD
        ret$A <- A
    }
    ret
}
<bytecode: 0xb8d85d0>
<environment: namespace:CEGO>
 --- function search by body ---
Function modelKrigingLikelihood in namespace CEGO has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(cholPsi) == "try-error") { : 
  the condition has length > 1
Calls: modelKriging -> <Anonymous> -> <Anonymous> -> eval_f
Execution halted