Running ‘test-all.R’ [3s/4s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library(testthat)
  > test_check("tsPI")
  Loading required package: tsPI
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  tsPI
   --- call from context --- 
  approx_marginal_jeffreys(psisim[i, ], p, q)
   --- call from argument --- 
  if (class(chol_im) != "try-error") {
      prod(diag(chol_im))
  } else 0
   --- R stacktrace ---
  where 1: approx_marginal_jeffreys(psisim[i, ], p, q)
  where 2 at testthat/test-arima_pi.R#54: arima_pi(lh, c(1, 0, 0), nsim = 50, prior = "approx_marginal")
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: 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 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: 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 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test-arima_pi.R#52: test_that("arima_pi with jeffreys gives same results each time", 
      {
          set.seed(1)
          pred <- arima_pi(lh, c(1, 0, 0), nsim = 50, prior = "approx_marginal")
          expect_equal(pred[1, "lwr"], 1.813243, tol = 1e-05, check.attributes = FALSE)
          pred <- arima_pi(lh, c(1, 0, 0), nsim = 50, prior = "approx_joint")
          expect_equal(pred[1, "lwr"], 1.759795, tol = 1e-05, check.attributes = FALSE)
          pred <- arima_pi(lh, c(1, 0, 0), nsim = 50, prior = "exact_marginal")
          expect_equal(pred[1, "lwr"], 1.795299, tol = 1e-05, check.attributes = FALSE)
          pred <- arima_pi(lh, c(1, 0, 0), nsim = 50, prior = "exact_joint")
          expect_equal(pred[1, "lwr"], 1.7381, tol = 1e-05, check.attributes = FALSE)
      })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: 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 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: 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 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: 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 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, 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 = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: 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 41: 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 42: test_check("tsPI")
  
   --- value of length: 2 type: logical ---
  [1] TRUE TRUE
   --- function from context --- 
  function (psi, p, q) 
  {
      phi <- if (p > 0) 
          psi[1:p]
      else NULL
      theta <- if (q > 0) 
          psi[p + 1:q]
      else NULL
      chol_im <- try(chol(information_arma(phi, theta)), silent = TRUE)
      if (class(chol_im) != "try-error") {
          prod(diag(chol_im))
      }
      else 0
  }
  <bytecode: 0x55eca2883450>
  <environment: namespace:tsPI>
   --- function search by body ---
  Function approx_marginal_jeffreys in namespace tsPI has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1