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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: consensusMCcov
> ### Title: Consensus Monte Carlo Algorithm (for correlated parameters)
> ### Aliases: consensusMCcov
> ### Keywords: combine consensus subposterior posterior parallel
> 
> ### ** Examples
> d      <- 2     # dimension of the parameter space  
> sampT  <- 1000  # number of subset posterior samples
> M      <- 3     # total number of subsets
> 
> ## simulate Gaussian subposterior samples
> 
> theta <- array(NA,c(d,sampT,M)) 
> 
> norm.mean <- c(1.0, 2.0)
> norm.sd   <- c(0.5, 1.0)
> 
> for (i in 1:d)
+   for (s in 1:M)        
+     theta[i,,s] <- rnorm(sampT, mean=norm.mean[i]+runif(1,-0.01,0.01), sd=norm.sd[i])
> 
> ## combine samples:
> 
> full.theta <- consensusMCcov(subchain=theta, shuff=FALSE)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
parallelMCMCcombine
 --- call from context --- 
consensusMCcov(subchain = theta, shuff = FALSE)
 --- call from argument --- 
if (class(res) == "try-error") {
    stop(paste("Computation of the inverse of a covariance matrix for", 
        "one of the sample vectors in the data subset #", k, 
        "is failed.", "Here is the system R error-message:\n", 
        attr(res, "condition")))
}
 --- R stacktrace ---
where 1: consensusMCcov(subchain = theta, shuff = FALSE)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (subchain, shuff = FALSE) 
{
    ddata = length(dim(subchain))
    if (ddata != 3) {
        stop("The subchain must be an array of dimension c(d,sampletotT,M).")
    }
    d <- dim(subchain)[1]
    sampletotT <- dim(subchain)[2]
    M <- dim(subchain)[3]
    if (M == 1) {
        theta <- array(subchain[, , 1], c(d, sampletotT))
        return(theta)
    }
    if (shuff == TRUE) {
        for (k in 1:M) subchain[, , k] <- subchain[, sample(sampletotT), 
            k]
    }
    sigmahatm <- array(NA, c(d, d, M))
    sigmahatM <- matrix(NA, d, d)
    sigmahatM.pre <- matrix(NA, d, d)
    if (d == 1) {
        for (k in 1:M) {
            sigmahatm[1, , k] <- var(subchain[1, , k])
        }
    }
    else {
        for (k in 1:M) {
            sigmahatm[, , k] <- cov(t(subchain[, , k]))
        }
    }
    sigmahatm.inverse <- array(NA, dim = c(d, d, M))
    for (k in 1:M) {
        res <- try(sigmahatm.inverse[, , k] <- solve(sigmahatm[, 
            , k]), silent = TRUE)
        if (class(res) == "try-error") {
            stop(paste("Computation of the inverse of a covariance matrix for", 
                "one of the sample vectors in the data subset #", 
                k, "is failed.", "Here is the system R error-message:\n", 
                attr(res, "condition")))
        }
    }
    sigmahatM <- solve(rowSums(sigmahatm.inverse, dims = 2))
    theta <- matrix(NA, nrow = d, ncol = sampletotT)
    wvec <- array(NA, c(d, 1))
    for (i in 1:sampletotT) {
        wvec <- rep(0, d)
        for (s in 1:M) {
            wvec <- wvec + sigmahatm.inverse[, , s] %*% subchain[, 
                i, s]
        }
        theta[, i] <- sigmahatM %*% wvec
    }
    return(theta)
}
<bytecode: 0x1c82c48>
<environment: namespace:parallelMCMCcombine>
 --- function search by body ---
Function consensusMCcov in namespace parallelMCMCcombine has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1