Running ‘testthat.R’ [4s/7s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(MCMCprecision)
  > 
  > test_check("MCMCprecision")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  MCMCprecision
   --- call from context --- 
  transitions(zmat)
   --- call from argument --- 
  if (class(z) %in% c("list", "mcmc.list")) {
      z <- do.call("cbind", z)
  }
   --- R stacktrace ---
  where 1: transitions(zmat)
  where 2: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  where 3: withVisible(code)
  where 4: withCallingHandlers(withVisible(code), warning = handle_warning, 
      message = handle_message)
  where 5: force(code)
  where 6: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), 
      warning = handle_warning, message = handle_message))
  where 7: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), 
      ...)
  where 8: quasi_capture(enquo(object), NULL, evaluate_promise)
  where 9 at testthat/test_transitions.R#25: expect_silent(t.mat <- transitions(zmat))
  where 10: eval(code, test_env)
  where 11: eval(code, test_env)
  where 12: 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 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 15: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 16: doTryCatch(return(expr), name, parentenv, handler)
  where 17: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 18: tryCatchList(expr, classes, parentenv, handlers)
  where 19: 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 20: test_code(desc, code, env = parent.frame())
  where 21 at testthat/test_transitions.R#9: test_that("'transitions' works", {
      expect_silent(t1 <- transitions(z))
      expect_is(t1, "matrix")
      expect_true(all(dim(t1) == c(m, m)))
      expect_error(transitions(z, labels = 1:2))
      expect_silent(t2 <- transitions(z, labels = 1:(m + 1)))
      expect_true(all(dim(t2) == c(m + 1, m + 1)))
      expect_silent(t.order2 <- transitions(z, order = 2))
      expect_is(t.order2, "array")
      expect_true(all(dim(t.order2) == c(m, m, m)))
      zmat <- matrix(z, ncol = 2)
      expect_silent(t.mat <- transitions(zmat))
      expect_is(t.mat, "matrix")
      expect_true(all(dim(t.mat) == c(m, m)))
      expect_equal(t.mat, transitions(zmat[, 1]) + transitions(zmat[, 
          2]))
  })
  where 22: eval(code, test_env)
  where 23: eval(code, test_env)
  where 24: 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 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 27: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 28: doTryCatch(return(expr), name, parentenv, handler)
  where 29: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 30: tryCatchList(expr, classes, parentenv, handlers)
  where 31: 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 32: test_code(NULL, exprs, env)
  where 33: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: 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 39: FUN(X[[i]], ...)
  where 40: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 41: force(code)
  where 42: doWithOneRestart(return(expr), restart)
  where 43: withOneRestart(expr, restarts[[1L]])
  where 44: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 45: 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 46: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 47: 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 48: 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 49: test_check("MCMCprecision")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (z, labels, order = 1) 
  {
      if (class(z) %in% c("list", "mcmc.list")) {
          z <- do.call("cbind", z)
      }
      if (missing(labels) || is.null(labels)) {
          labels <- sort(unique(as.vector(z)))
      }
      else if (!all(z %in% labels)) {
          stop("'labels' does not include all elements in the sequence 'z'.")
      }
      if (is.matrix(z)) {
          tabs <- lapply(split(z, rep(1:ncol(z), each = nrow(z))), 
              transitions, labels = labels, order = order)
          tab <- Reduce("+", tabs)
      }
      else {
          n <- length(z)
          if (order == 1) {
              tab <- table(factor(z[1:(n - 1)], levels = labels), 
                  factor(z[2:n], levels = labels))
              class(tab) <- "matrix"
              dimnames(tab) <- list(t = labels, `t+1` = labels)
          }
          else {
              tab <- table(factor(z[1:(n - 2)], levels = labels), 
                  factor(z[2:(n - 1)], levels = labels), factor(z[3:n], 
                    levels = labels))
              class(tab) <- "array"
              dimnames(tab) <- list(t = labels, `t+1` = labels, 
                  `t+2` = labels)
          }
      }
      tab
  }
  <bytecode: 0x561c692355c0>
  <environment: namespace:MCMCprecision>
   --- function search by body ---
  Function transitions in namespace MCMCprecision has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1