Running ‘testthat.R’ [7s/10s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > Sys.setenv("R_TESTS" = "")
  > 
  > library(BayesianTools)
  > library(testthat)
  > 
  > test_check("BayesianTools")
  [1] "Info is missing upper/lower/best. This can cause plotting and sensitivity analysis functions to fail. If you want to use those functions provide (plot)upper/lower/best either in createBayesianSetup or prior"
  [1] "Info is missing upper/lower/best. This can cause plotting and sensitivity analysis functions to fail. If you want to use those functions provide (plot)upper/lower/best either in createBayesianSetup or prior"
  [1] "Info is missing upper/lower/best. This can cause plotting and sensitivity analysis functions to fail. If you want to use those functions provide (plot)upper/lower/best either in createBayesianSetup or prior"
  [1] "Info is missing upper/lower/best. This can cause plotting and sensitivity analysis functions to fail. If you want to use those functions provide (plot)upper/lower/best either in createBayesianSetup or prior"
  [1] "Info is missing upper/lower/best. This can cause plotting and sensitivity analysis functions to fail. If you want to use those functions provide (plot)upper/lower/best either in createBayesianSetup or prior"
  [1] "Info is missing upper/lower/best. This can cause plotting and sensitivity analysis functions to fail. If you want to use those functions provide (plot)upper/lower/best either in createBayesianSetup or prior"
  Parameter values  2 
  
   Running DEzs-MCMC, chain  1 iteration 300 of 10002 . Current logp  -12.19371 -13.64799 -13.29666 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 600 of 10002 . Current logp  -12.18833 -12.99466 -12.17958 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 900 of 10002 . Current logp  -14.19554 -12.821 -12.55708 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 1200 of 10002 . Current logp  -12.37667 -12.64628 -13.71719 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 1500 of 10002 . Current logp  -12.20127 -12.55139 -13.1001 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 1800 of 10002 . Current logp  -13.44542 -14.71315 -12.13199 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 2100 of 10002 . Current logp  -15.17826 -12.45646 -13.72953 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 2400 of 10002 . Current logp  -12.35374 -13.22856 -12.81674 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 2700 of 10002 . Current logp  -12.36539 -11.94747 -12.09891 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 3000 of 10002 . Current logp  -11.92921 -11.85908 -11.93578 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 3300 of 10002 . Current logp  -13.07951 -12.56317 -12.11614 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 3600 of 10002 . Current logp  -12.59702 -13.82955 -13.14808 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 3900 of 10002 . Current logp  -14.28125 -12.91158 -12.09197 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 4200 of 10002 . Current logp  -13.0833 -13.74275 -12.07057 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 4500 of 10002 . Current logp  -12.72827 -12.74501 -14.25913 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 4800 of 10002 . Current logp  -12.0969 -12.15335 -12.33806 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 5100 of 10002 . Current logp  -11.78102 -12.742 -12.67636 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 5400 of 10002 . Current logp  -11.82097 -13.52101 -12.19262 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 5700 of 10002 . Current logp  -13.33545 -12.92858 -13.84875 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 6000 of 10002 . Current logp  -12.34061 -16.80907 -16.12043 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 6300 of 10002 . Current logp  -15.58476 -11.96842 -12.68013 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 6600 of 10002 . Current logp  -14.27811 -12.35165 -12.36343 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 6900 of 10002 . Current logp  -12.76534 -12.26315 -13.08162 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 7200 of 10002 . Current logp  -14.56142 -14.27356 -16.04857 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 7500 of 10002 . Current logp  -12.91192 -13.195 -12.24397 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 7800 of 10002 . Current logp  -14.23117 -12.46446 -15.0657 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 8100 of 10002 . Current logp  -14.16297 -14.58665 -12.8106 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 8400 of 10002 . Current logp  -14.60913 -14.14966 -12.98997 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 8700 of 10002 . Current logp  -12.576 -16.47122 -17.21286 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 9000 of 10002 . Current logp  -14.76868 -14.44828 -17.18949 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 9300 of 10002 . Current logp  -12.88687 -13.37836 -12.46675 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 9600 of 10002 . Current logp  -12.94045 -13.33405 -13.22825 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 9900 of 10002 . Current logp  -12.64017 -16.63402 -11.79927 . Please wait! 
  
   Running DEzs-MCMC, chain  1 iteration 10002 of 10002 . Current logp  -11.9947 -12.64818 -14.59925 . Please wait! 
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  BayesianTools
   --- call from context --- 
  getSample.mcmcSampler(out, numSamples = 10000)
   --- call from argument --- 
  if (class(temp) == "numeric") temp = as.matrix(temp)
   --- R stacktrace ---
  where 1: getSample.mcmcSampler(out, numSamples = 10000)
  where 2: getSample(out, numSamples = 10000)
  where 3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  where 4 at testthat/test-marginalPlot.R#32: suppressWarnings(getSample(out, numSamples = 10000))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: 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 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: 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 15: test_code(NULL, exprs, env)
  where 16: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 17: force(code)
  where 18: doWithOneRestart(return(expr), restart)
  where 19: withOneRestart(expr, restarts[[1L]])
  where 20: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 21: 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 22: FUN(X[[i]], ...)
  where 23: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 24: force(code)
  where 25: doWithOneRestart(return(expr), restart)
  where 26: withOneRestart(expr, restarts[[1L]])
  where 27: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 28: 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 29: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 30: 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 31: 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 32: test_check("BayesianTools")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (sampler, parametersOnly = T, coda = F, start = 1, end = NULL, 
      thin = 1, numSamples = NULL, whichParameters = NULL, includesProbabilities = F, 
      reportDiagnostics = F, ...) 
  {
      if (class(sampler$chain) == "matrix") {
          if (is.null(end)) 
              end = nrow(sampler$chain)
          if (parametersOnly == T) {
              out = sampler$chain[start:end, 1:sampler$setup$numPars]
              if (class(out) == "numeric") 
                  out = as.matrix(out)
              if (!is.null(sampler$setup$names)) 
                  colnames(out) = sampler$setup$names
          }
          else {
              out = sampler$chain[start:end, ]
              if (!is.null(sampler$setup$names)) 
                  colnames(out) = c(sampler$setup$names, "Lposterior", 
                    "Llikelihood", "Lprior")
          }
          if (thin == "auto") {
              thin = max(floor(nrow(out)/5000), 1)
          }
          if (is.null(thin) || thin == F || thin < 1 || is.nan(thin)) 
              thin = 1
          if (thin > nrow(out)) 
              warning("thin is greater than the total number of samples!")
          if (!thin == 1) {
              sel = seq(1, dim(out)[1], by = thin)
              out = out[sel, ]
          }
          if (thin == 1 && !is.null(numSamples)) {
              out <- sampleEquallySpaced(out, numSamples)
          }
          if (!is.null(whichParameters)) 
              out = out[, whichParameters]
          if (coda == T) 
              out = makeObjectClassCodaMCMC(out, start = start, 
                  end = end, thin = thin)
      }
      else if (class(sampler$chain) == "mcmc.list") {
          out = list()
          for (i in 1:length(sampler$chain)) {
              if (is.null(end)) 
                  end = nrow(sampler$chain[[1]])
              temp = sampler$chain[[i]][start:end, ]
              if (parametersOnly == T) {
                  temp = temp[, 1:sampler$setup$numPars]
                  if (class(temp) == "numeric") 
                    temp = as.matrix(temp)
                  if (!is.null(sampler$setup$names)) 
                    colnames(temp) = sampler$setup$names
              }
              else {
                  if (!is.null(sampler$setup$names)) 
                    colnames(temp) = c(sampler$setup$names, "Lposterior", 
                      "Llikelihood", "Lprior")
              }
              if (thin == "auto") {
                  thin = max(floor(nrow(temp)/5000), 1)
              }
              if (is.null(thin) || thin == F || thin < 1 || is.nan(thin)) 
                  thin = 1
              if (thin > nrow(temp)) 
                  warning("thin is greater than the total number of samples!")
              if (!thin == 1) {
                  sel = seq(1, dim(temp)[1], by = thin)
                  temp = temp[sel, ]
              }
              if (thin == 1 && !is.null(numSamples)) {
                  nSamplesPerChain <- ceiling(numSamples/length(sampler$chain))
                  if (i == 1) {
                    if (nSamplesPerChain * length(sampler$chain) > 
                      numSamples) 
                      warning("Due to internal chains, numSamples was rounded to the next number divisble by the number of chains.", 
                        call. = FALSE)
                  }
                  temp <- sampleEquallySpaced(temp, nSamplesPerChain)
              }
              if (!is.null(whichParameters)) 
                  temp = temp[, whichParameters]
              out[[i]] = makeObjectClassCodaMCMC(temp, start = start, 
                  end = end, thin = thin)
          }
          class(out) = "mcmc.list"
          if (coda == F) {
              out = combineChains(out)
          }
          if (coda == T) {
              out = out
          }
      }
      else stop("sampler appears not to be of class mcmcSampler")
      if (reportDiagnostics == T) {
          return(list(chain = out, start = start, end = end, thin = thin))
      }
      else return(out)
  }
  <bytecode: 0x560c1db132c8>
  <environment: namespace:BayesianTools>
   --- function search by body ---
  Function getSample.mcmcSampler in namespace BayesianTools has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1