Running ‘testthat.R’ [15s/56s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(vdiffr)
  > library(RoBMA)
  Loading required namespace: runjags
  Loading required namespace: mvtnorm
  > 
  > test_check("RoBMA")
  [ FAIL 3 | WARN 0 | SKIP 1 | PASS 1 ]
  
  ══ Skipped tests (1) ═══════════════════════════════════════════════════════════
  • On CRAN (1): 'test-9-validation.R:2:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-0-CRAN.R:17:3'): Basic functionality works ───────────────────
  capture_output_lines(fit_default, print = TRUE, width = 150) not equal to c(...).
  Lengths differ: 7 is not 9
  ── Failure ('test-0-CRAN.R:30:3'): Basic functionality works ───────────────────
  capture_output_lines(summary(fit_default), print = TRUE, width = 150) not equal to c(...).
  Lengths differ: 23 is not 31
  ── Error ('test-0-CRAN.R:73:3'): Basic functionality works ─────────────────────
  Error in `if (priors_info[["treatment"]]) {
      if (levels == 1) {
          samples <- .mix_posteriors.simple(fits, priors, parameter, 
              post_probs, seed, n_samples)
          sample_ind <- attr(samples, "sample_ind")
          models_ind <- attr(samples, "models_ind")
          samples <- matrix(samples, ncol = 1)
      }
      else {
          if (is.null(seed)) {
              seed <- sample(666666, 1)
          }
          samples <- lapply(1:levels, function(i) .mix_posteriors.simple(fits, 
              priors, paste0(parameter, "[", i, "]"), post_probs, 
              seed, n_samples))
          sample_ind <- attr(samples[[1]], "sample_ind")
          models_ind <- attr(samples[[1]], "models_ind")
          samples <- do.call(cbind, samples)
      }
      rownames(samples) <- NULL
      colnames(samples) <- paste0(parameter, "[", priors_info$level_names[-1], 
          "]")
      attr(samples, "sample_ind") <- sample_ind
      attr(samples, "models_ind") <- models_ind
      attr(samples, "parameter") <- parameter
      attr(samples, "prior_list") <- priors
      class(samples) <- c("mixed_posteriors", "mixed_posteriors.factor", 
          "mixed_posteriors.vector")
  } else if (priors_info[["independent"]]) {
      if (levels == 1) {
          samples <- .mix_posteriors.simple(fits, priors, parameter, 
              post_probs, seed, n_samples)
          sample_ind <- attr(samples, "sample_ind")
          models_ind <- attr(samples, "models_ind")
          samples <- matrix(samples, ncol = 1)
      }
      else {
          if (is.null(seed)) {
              seed <- sample(666666, 1)
          }
          samples <- lapply(1:levels, function(i) .mix_posteriors.simple(fits, 
              priors, paste0(parameter, "[", i, "]"), post_probs, 
              seed, n_samples))
          sample_ind <- attr(samples[[1]], "sample_ind")
          models_ind <- attr(samples[[1]], "models_ind")
          samples <- do.call(cbind, samples)
      }
      rownames(samples) <- NULL
      colnames(samples) <- paste0(parameter, "[", priors_info$level_names, 
          "]")
      attr(samples, "sample_ind") <- sample_ind
      attr(samples, "models_ind") <- models_ind
      attr(samples, "parameter") <- parameter
      attr(samples, "prior_list") <- priors
      class(samples) <- c("mixed_posteriors", "mixed_posteriors.factor", 
          "mixed_posteriors.vector")
  } else if (priors_info[["orthonormal"]] | priors_info[["meandif"]]) {
      for (i in seq_along(priors)) {
          if (is.prior.factor(priors[[i]])) {
              priors[[i]]$parameters[["K"]] <- levels
          }
      }
      samples <- .mix_posteriors.vector(fits, priors, parameter, 
          post_probs, seed, n_samples)
      class(samples) <- c(class(samples), "mixed_posteriors.factor")
  }`: argument is of length zero
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(...) at test-0-CRAN.R:73:2
   2. │ └─base::withCallingHandlers(...)
   3. └─RoBMA::RoBMA.reg(...)
   4.   └─RoBMA:::.ensemble_inference(object)
   5.     └─BayesTools::mix_posteriors(...)
   6.       └─BayesTools:::.mix_posteriors.factor(...)
  
  [ FAIL 3 | WARN 0 | SKIP 1 | PASS 1 ]
  Error: Test failures
  Execution halted