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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: do.many.wqs
> ### Title: Performing Many WQS Regressions
> ### Aliases: do.many.wqs
> ### Keywords: wqs
> 
> ### ** Examples
> 
> data("simdata87")
> # Create 2 multiple imputed datasets using bootstrapping, but only use first 2 chemicals.
> l <- impute.boot(
+   X = simdata87$X.bdl[, 1:2], DL = simdata87$DL[1:2],
+   Z = simdata87$Z.sim[, 1], K = 2
+ )
#> Check: The total number of imputed values that are above the detection limit is 0.
> # Perform WQS regression on each imputed dataset
> set.seed(50679)
> bayes.wqs <- do.many.wqs(
+   y = simdata87$y.scenario, X.imputed = l$X.imputed,
+   Z = simdata87$Z.sim,
+   B = 10, family = "binomial"
+ )
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
miWQS
 --- call from context --- 
do.many.wqs(y = simdata87$y.scenario, X.imputed = l$X.imputed, 
    Z = simdata87$Z.sim, B = 10, family = "binomial")
 --- call from argument --- 
if (class(Z) == "numeric") {
    Z <- as.matrix(Z)
}
 --- R stacktrace ---
where 1: do.many.wqs(y = simdata87$y.scenario, X.imputed = l$X.imputed, 
    Z = simdata87$Z.sim, B = 10, family = "binomial")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (y, X.imputed, Z = NULL, B = 100, ...) 
{
    if (anyNA(X.imputed)) {
        stop("Some components in X.imputed are missing")
    }
    n <- dim(X.imputed)[[1]]
    C <- dim(X.imputed)[[2]]
    K <- if (class(X.imputed) == "array") {
        dim(X.imputed)[[3]]
    }
    else {
        1
    }
    if (class(Z) == "numeric") {
        Z <- as.matrix(Z)
    }
    t.p <- C + 2 + ifelse(is.null(Z), 0, ncol(Z) + 50)
    cat("#> Number of chemicals: ", ncol(X.imputed), ";  Number of completed datasets: ", 
        K, "\n", sep = "")
    AIC <- rep(NA, K)
    train.comparison <- vector("list", length = K)
    initial <- NA
    train.estimates <- NA
    fit.validate <- vector("list", length = K)
    WQS <- matrix(NA, nrow = n, ncol = K, dimnames = list(NULL, 
        paste0("Imputed.", 1:K)))
    wqs.imputed.estimates <- array(NA, dim = c(t.p, 2, K), dimnames = list(NULL, 
        c("Estimate", "Std.Error"), paste0("Imputed.", 1:K)))
    for (k in 1:K) {
        wqs.imputed <- suppressMessages(estimate.wqs(y = y, X = X.imputed[, 
            , k], Z = Z, place.bdls.in.Q1 = FALSE, B = B, ...))
        AIC[k] <- AIC(wqs.imputed$fit)
        train.comparison[[k]] <- wqs.imputed$train.comparison
        initial <- cbind(initial, wqs.imputed$initial)
        train.estimates <- rbind(train.estimates, data.frame(wqs.imputed$train.estimates, 
            boot = 1:B, imputed = k))
        fit.validate[[k]] <- wqs.imputed$fit
        WQS[, k] <- wqs.imputed$WQS
        a <- rbind(wqs.imputed$processed.weights, summary(wqs.imputed$fit)$coefficients[, 
            1:2])
        wqs.imputed.estimates[1:nrow(a), , k] <- a
        wqs.imputed.estimates <- wqs.imputed.estimates[1:nrow(a), 
            , , drop = FALSE]
        dimnames(wqs.imputed.estimates)[[1]] <- dimnames(a)[[1]]
    }
    initial <- initial[, -1, drop = FALSE]
    colnames(initial) <- paste0("Imputed.", 1:K)
    train.estimates <- train.estimates[-1, ]
    rownames(train.estimates) <- NULL
    D <- formals(do.many.wqs)
    A <- as.list(match.call())
    U <- rlist::list.merge(D, A)
    out <- list(call = U, C = wqs.imputed$C, n = wqs.imputed$n, 
        wqs.imputed.estimates = wqs.imputed.estimates, AIC = AIC, 
        train.index = wqs.imputed$train.index, q.train = wqs.imputed$q.train, 
        train.comparison = train.comparison, initial = initial, 
        WQS = WQS, wqs.train.estimates = train.estimates, wqs.fit = fit.validate)
    return(out)
}
<bytecode: 0x69721b8>
<environment: namespace:miWQS>
 --- function search by body ---
Function do.many.wqs in namespace miWQS has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1