Running examples in ‘BayesianTools-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: bridgesample
> ### Title: Calculates the marginal likelihood of a chain via bridge
> ###   sampling
> ### Aliases: bridgesample
> ### Keywords: internal
> 
> ### ** Examples
> 
> means <- c(0, 1, 2)
> sds <- c(1, 0.6, 3)
> 
> # log-likelihood
> ll <- function (x) {
+   return(sum(dnorm(x, mean = means, sd = sds, log = TRUE)))
+ }
> 
> # lower and upper bounds for prior
> lb <- rep(-10, 3)
> ub <- rep(10, 3)
> 
> # create setup and run MCMC
> setup <- createBayesianSetup(likelihood = ll,
+                              lower = lb,
+                              upper = ub)
> 
> out <- runMCMC(bayesianSetup = setup,
+                settings = list(iterations = 1000),
+                sampler = "DEzs")

 Running DEzs-MCMC, chain  1 iteration 300 of 1002 . Current logp  -13.45132 -14.0386 -12.89206 . Please wait! 

 Running DEzs-MCMC, chain  1 iteration 600 of 1002 . Current logp  -14.01405 -13.97087 -14.01756 . Please wait! 

 Running DEzs-MCMC, chain  1 iteration 900 of 1002 . Current logp  -13.0555 -13.32697 -12.47774 . Please wait! 

 Running DEzs-MCMC, chain  1 iteration 1002 of 1002 . Current logp  -13.8484 -14.97426 -13.62142 . Please wait! 
runMCMC terminated after 0.250999999999999seconds
> 
> # sample from MCMC output with "burn-in" of 25%
> sample <- getSample(out$chain, start = 250, numSamples = 500)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
BayesianTools
 --- call from context --- 
getSample.matrix(combineChains(sampler), parametersOnly = parametersOnly, 
    coda = coda, start = start, end = end, thin = thin, numSamples = numSamples, 
    whichParameters = whichParameters, includesProbabilities = includesProbabilities, 
    reportDiagnostics = reportDiagnostics)
 --- call from argument --- 
if (class(out) == "numeric") out = as.matrix(sampler)
 --- R stacktrace ---
where 1: getSample.matrix(combineChains(sampler), parametersOnly = parametersOnly, 
    coda = coda, start = start, end = end, thin = thin, numSamples = numSamples, 
    whichParameters = whichParameters, includesProbabilities = includesProbabilities, 
    reportDiagnostics = reportDiagnostics)
where 2: getSample(combineChains(sampler), parametersOnly = parametersOnly, 
    coda = coda, start = start, end = end, thin = thin, numSamples = numSamples, 
    whichParameters = whichParameters, includesProbabilities = includesProbabilities, 
    reportDiagnostics = reportDiagnostics)
where 3: getSample.mcmc.list(out$chain, start = 250, numSamples = 500)
where 4: getSample(out$chain, start = 250, numSamples = 500)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (sampler, parametersOnly = T, coda = F, start = 1, end = NULL, 
    thin = "auto", numSamples = NULL, whichParameters = NULL, 
    includesProbabilities = F, reportDiagnostics = F, ...) 
{
    if (is.null(end)) 
        end = nrow(sampler)
    if (includesProbabilities) 
        nPars = ncol(sampler) - 3
    else nPars = ncol(sampler)
    if (parametersOnly == T | includesProbabilities == F) {
        out = sampler[start:end, 1:nPars]
        if (class(out) == "numeric") 
            out = as.matrix(sampler)
    }
    else {
        out = out[start:end, ]
    }
    if (!is.matrix(out)) {
        out <- matrix(out, ncol = nPars)
    }
    nTotalSamples <- nrow(out)
    thin <- correctThin(nTotalSamples, thin = thin)
    if (thin == 1 && !is.null(numSamples)) {
        out <- sampleEquallySpaced(out, numSamples)
    }
    else {
        sel = seq(1, nTotalSamples, by = thin)
        out = out[sel, ]
        if (!is.matrix(out)) 
            out <- matrix(out, ncol = nPars)
    }
    if (!is.null(whichParameters)) 
        out = out[, whichParameters]
    if (coda == T) 
        out = makeObjectClassCodaMCMC(out, start = start, end = end, 
            thin = thin)
    if (reportDiagnostics == T) {
        return(list(chain = out, start = start, end = end, thin = thin))
    }
    else return(out)
}
<bytecode: 0x55c3ac857720>
<environment: namespace:BayesianTools>
 --- function search by body ---
Function getSample.matrix in namespace BayesianTools has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1