Running 'testthat.R' [6s/6s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > 
  > library(testthat)
  > library(ecd)
  > library(ldhmm)
  > test_check("ldhmm")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ldhmm
   --- call from context --- 
  ldhmm(m = m, param = param0, gamma = gamma0, delta = delta0)
   --- call from argument --- 
  if (class(gamma) == "numeric") {
      if (length(gamma) != m * m) 
          stop(paste("gamma is a vector, but length is not m by m:", 
              length(gamma)))
      gamma <- ldhmm.gamma_init(m, prob = gamma)
  }
   --- R stacktrace ---
  where 1 at testthat/test-forecast-ldhmm.R#20: ldhmm(m = m, param = param0, gamma = gamma0, delta = delta0)
  where 2: eval(code, test_env)
  where 3: eval(code, test_env)
  where 4: 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 5: doTryCatch(return(expr), name, parentenv, handler)
  where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 10: tryCatchList(expr, classes, parentenv, handlers)
  where 11: 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 12: test_code(NULL, exprs, env)
  where 13: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 14: force(code)
  where 15: doWithOneRestart(return(expr), restart)
  where 16: withOneRestart(expr, restarts[[1L]])
  where 17: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 18: 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 19: FUN(X[[i]], ...)
  where 20: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 21: force(code)
  where 22: doWithOneRestart(return(expr), restart)
  where 23: withOneRestart(expr, restarts[[1L]])
  where 24: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 25: 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 26: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 27: 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 28: 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 29: test_check("ldhmm")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (m, param, gamma, delta = NULL, stationary = TRUE, mle.optimizer = "nlm") 
  {
      call <- match.call()
      param.nbr <- NCOL(param)
      if (length(m) != 1 | m%%1 != 0) 
          stop("m must be an integer")
      if (param.nbr%%1 != 0) 
          stop("param.nbr must be integer")
      if (param.nbr != 2 & param.nbr != 3) 
          stop("param.nbr must be 2 or 3")
      if (NROW(param) != m) 
          stop("param must have m rows")
      if (stationary == FALSE) {
          if (length(delta) != m) 
              stop("delta must be length-m vector when stationary is not true")
      }
      if (class(gamma) == "numeric") {
          if (length(gamma) != m * m) 
              stop(paste("gamma is a vector, but length is not m by m:", 
                  length(gamma)))
          gamma <- ldhmm.gamma_init(m, prob = gamma)
      }
      if (NROW(gamma) != m | NCOL(gamma) != m) 
          stop("gamma must be mxm matrix")
      if (param.nbr == 2) 
          colnames(param) <- c("mu", "sigma")
      if (param.nbr == 3) 
          colnames(param) <- c("mu", "sigma", "lambda")
      d <- new("ldhmm", call = call, m = unname(m), param.nbr = param.nbr, 
          param = param, gamma = gamma, delta = delta, stationary = stationary, 
          mle.optimizer = mle.optimizer)
      invisible(d)
  }
  <bytecode: 0x5e5bd38>
  <environment: namespace:ldhmm>
   --- function search by body ---
  Function ldhmm in namespace ldhmm has this body.
  Function ldhmm in namespace ldhmm has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1