Running ‘testthat.R’ [95s/75s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(seqHMM)
  Please cite seqHMM appropriately, see `citation('seqHMM')` for details.
  > 
  > test_check("seqHMM")
  Saving _problems/test-bootstrap-63.R
  Saving _problems/test-bootstrap-67.R
  Saving _problems/test-bootstrap-68.R
  Saving _problems/test-bootstrap-123.R
  Saving _problems/test-bootstrap-124.R
  Saving _problems/test-bootstrap-125.R
  Saving _problems/test-formulas-62.R
  Saving _problems/test-formulas-66.R
  Saving _problems/test-formulas-67.R
  Saving _problems/test-get_probs-42.R
  Saving _problems/test-get_probs-122.R
  Saving _problems/test-get_probs-142.R
  Saving _problems/test-get_probs-200.R
  Saving _problems/test-get_probs-204.R
  Saving _problems/test-misc-117.R
  Saving _problems/test-posterior_probs-7.R
  Saving _problems/test-posterior_probs-8.R
  Saving _problems/test-posterior_probs-16.R
  Saving _problems/test-posterior_probs-17.R
  Saving _problems/test-posterior_probs-38.R
  Saving _problems/test-posterior_probs-39.R
  Saving _problems/test-posterior_probs-78.R
  Saving _problems/test-posterior_probs-79.R
  Saving _problems/test-predict-66.R
  [ FAIL 24 | WARN 0 | SKIP 2 | PASS 302 ]
  
  ══ Skipped tests (2) ═══════════════════════════════════════════════════════════
  • run_extended_tests is not TRUE (2): 'test-extended.R:5:5',
    'test-extended.R:88:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-bootstrap.R:60:3'): boostrap works for `mnhmm` ───────────────
  Expected `fit <- bootstrap_coefs(fit, type = "nonparametric", nsim = 2)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 6/6 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-bootstrap.R:60:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::bootstrap_coefs(fit, type = "nonparametric", nsim = 2)
    8. └─seqHMM:::bootstrap_coefs.mnhmm(fit, type = "nonparametric", nsim = 2)
    9.   ├─base::matrix(...)
   10.   └─seqHMM::posterior_cluster_probabilities(model)
   11.     ├─seqHMM::posterior_probs(x)
   12.     └─seqHMM:::posterior_probs.mnhmm(x)
   13.       ├─...[]
   14.       └─data.table:::`[.data.table`(...)
  ── Failure ('test-bootstrap.R:64:3'): boostrap works for `mnhmm` ───────────────
  Expected `fit <- bootstrap_coefs(fit, type = "parametric", nsim = 2, append = TRUE)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 6/6 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-bootstrap.R:64:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::bootstrap_coefs(fit, type = "parametric", nsim = 2, append = TRUE)
    8. └─seqHMM:::bootstrap_coefs.mnhmm(...)
    9.   ├─base::matrix(...)
   10.   └─seqHMM::posterior_cluster_probabilities(model)
   11.     ├─seqHMM::posterior_probs(x)
   12.     └─seqHMM:::posterior_probs.mnhmm(x)
   13.       ├─...[]
   14.       └─data.table:::`[.data.table`(...)
  ── Failure ('test-bootstrap.R:68:3'): boostrap works for `mnhmm` ───────────────
  Expected `length(fit$boot)` to equal 5L.
  Differences:
    `actual`: 0
  `expected`: 5
  
  ── Failure ('test-bootstrap.R:120:3'): boostrap works for `mfanhmm` ────────────
  Expected `fit <- bootstrap_coefs(fit, type = "nonparametric", nsim = 2)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 6/6 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-bootstrap.R:120:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::bootstrap_coefs(fit, type = "nonparametric", nsim = 2)
    8. └─seqHMM:::bootstrap_coefs.mnhmm(fit, type = "nonparametric", nsim = 2)
    9.   ├─base::matrix(...)
   10.   └─seqHMM::posterior_cluster_probabilities(model)
   11.     ├─seqHMM::posterior_probs(x)
   12.     └─seqHMM:::posterior_probs.mnhmm(x)
   13.       ├─...[]
   14.       └─data.table:::`[.data.table`(...)
  ── Failure ('test-bootstrap.R:124:3'): boostrap works for `mfanhmm` ────────────
  Expected `length(fit$boot)` to equal 5L.
  Differences:
    `actual`: 0
  `expected`: 5
  
  ── Failure ('test-bootstrap.R:125:3'): boostrap works for `mfanhmm` ────────────
  Expected `length(fit$boot[[1]])` to equal 2L.
  Differences:
    `actual`: 0
  `expected`: 2
  
  ── Failure ('test-formulas.R:59:3'): boostrap works for `mnhmm` ────────────────
  Expected `fit <- bootstrap_coefs(fit, type = "nonparametric", nsim = 2)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 6/6 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-formulas.R:59:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::bootstrap_coefs(fit, type = "nonparametric", nsim = 2)
    8. └─seqHMM:::bootstrap_coefs.mnhmm(fit, type = "nonparametric", nsim = 2)
    9.   ├─base::matrix(...)
   10.   └─seqHMM::posterior_cluster_probabilities(model)
   11.     ├─seqHMM::posterior_probs(x)
   12.     └─seqHMM:::posterior_probs.mnhmm(x)
   13.       ├─...[]
   14.       └─data.table:::`[.data.table`(...)
  ── Failure ('test-formulas.R:63:3'): boostrap works for `mnhmm` ────────────────
  Expected `fit <- bootstrap_coefs(fit, type = "parametric", nsim = 2, append = TRUE)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 6/6 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-formulas.R:63:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::bootstrap_coefs(fit, type = "parametric", nsim = 2, append = TRUE)
    8. └─seqHMM:::bootstrap_coefs.mnhmm(...)
    9.   ├─base::matrix(...)
   10.   └─seqHMM::posterior_cluster_probabilities(model)
   11.     ├─seqHMM::posterior_probs(x)
   12.     └─seqHMM:::posterior_probs.mnhmm(x)
   13.       ├─...[]
   14.       └─data.table:::`[.data.table`(...)
  ── Failure ('test-formulas.R:67:3'): boostrap works for `mnhmm` ────────────────
  Expected `length(fit$boot)` to equal 5L.
  Differences:
    `actual`: 0
  `expected`: 5
  
  ── Failure ('test-get_probs.R:39:3'): 'get_probs' and 'coef' works for multichannel 'nhmm' ──
  Expected `marginals <- get_marginals(fit)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(marginals <- get_marginals(fit), NA) at test-get_probs.R:39:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─seqHMM::get_marginals(fit)
    8.   ├─seqHMM::posterior_probs(model)
    9.   └─seqHMM:::posterior_probs.nhmm(model)
   10.     ├─...[]
   11.     └─data.table:::`[.data.table`(...)
  ── Failure ('test-get_probs.R:119:3'): 'get_probs' and 'coef' works for single-channel 'mnhmm' ──
  Expected `fit <- bootstrap_coefs(fit, nsim = 10)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 6/6 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-get_probs.R:119:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::bootstrap_coefs(fit, nsim = 10)
    8. └─seqHMM:::bootstrap_coefs.mnhmm(fit, nsim = 10)
    9.   ├─base::matrix(...)
   10.   └─seqHMM::posterior_cluster_probabilities(model)
   11.     ├─seqHMM::posterior_probs(x)
   12.     └─seqHMM:::posterior_probs.mnhmm(x)
   13.       ├─...[]
   14.       └─data.table:::`[.data.table`(...)
  ── Failure ('test-get_probs.R:139:3'): 'get_probs' and 'coef' works for single-channel 'mnhmm' ──
  Expected `coef(fit, probs = 0.5)` not to throw any errors.
  Actually got a <rlang_error> with message:
    Model does not contain bootstrap samples of coefficients. Run `bootstrap_coefs()` first.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(coef(fit, probs = 0.5), NA) at test-get_probs.R:139:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─stats::coef(fit, probs = 0.5)
    8. └─seqHMM:::coef.mnhmm(fit, probs = 0.5)
    9.   └─seqHMM:::stopifnot_(...)
   10.     └─cli::cli_abort(message, ..., .envir = parent.frame(), call = call)
   11.       └─rlang::abort(...)
  ── Failure ('test-get_probs.R:197:3'): 'get_probs' and 'coef' works for 'fanhmm' ──
  Expected `... <- NULL` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-get_probs.R:197:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─seqHMM::get_marginals(fanhmm_leaves, probs = c(0.1, 0.5, 0.9))
    8.   ├─seqHMM::posterior_probs(model)
    9.   └─seqHMM:::posterior_probs.nhmm(model)
   10.     ├─...[]
   11.     └─data.table:::`[.data.table`(...)
  ── Error ('test-get_probs.R:201:3'): 'get_probs' and 'coef' works for 'fanhmm' ──
  Error in `eval(code, test_env)`: object 'marginals' not found
  Backtrace:
      ▆
   1. └─testthat::expect_equal(...) at test-get_probs.R:201:3
   2.   └─testthat::quasi_label(enquo(object), label)
   3.     └─rlang::eval_bare(expr, quo_get_env(quo))
  ── Error ('test-misc.R:114:3'): 'most_probable_cluster' works ──────────────────
  Error in ``[.data.table`(out, , `:=`(ll, logSumExp(log_alpha[time == time[.N]])), by = id, showProgress = FALSE)`: attempt access index 6/6 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-misc.R:114:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─seqHMM::most_probable_cluster(mhmm_biofam, type = "posterior")
   5.   └─seqHMM::posterior_cluster_probabilities(x)
   6.     ├─seqHMM::posterior_probs(x)
   7.     └─seqHMM:::posterior_probs.mhmm(x)
   8.       ├─...[]
   9.       └─data.table:::`[.data.table`(...)
  ── Failure ('test-posterior_probs.R:4:3'): 'posterior_probs' works for 'hmm' ───
  Expected `out <- posterior_probs(hmm_biofam)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(out <- posterior_probs(hmm_biofam), NA) at test-posterior_probs.R:4:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::posterior_probs(hmm_biofam)
    8. └─seqHMM:::posterior_probs.hmm(hmm_biofam)
    9.   ├─...[]
   10.   └─data.table:::`[.data.table`(...)
  ── Error ('test-posterior_probs.R:8:3'): 'posterior_probs' works for 'hmm' ─────
  Error in `eval(code, test_env)`: object 'out' not found
  Backtrace:
      ▆
   1. └─testthat::expect_gte(min(out$probability), 0 - 1e-12) at test-posterior_probs.R:8:3
   2.   └─testthat::quasi_label(enquo(object), label)
   3.     └─rlang::eval_bare(expr, quo_get_env(quo))
  ── Failure ('test-posterior_probs.R:13:3'): 'posterior_probs' works for 'mhmm' ──
  Expected `out <- posterior_probs(mhmm_biofam)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 6/6 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(out <- posterior_probs(mhmm_biofam), NA) at test-posterior_probs.R:13:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::posterior_probs(mhmm_biofam)
    8. └─seqHMM:::posterior_probs.mhmm(mhmm_biofam)
    9.   ├─...[]
   10.   └─data.table:::`[.data.table`(...)
  ── Error ('test-posterior_probs.R:17:3'): 'posterior_probs' works for 'mhmm' ───
  Error in `eval(code, test_env)`: object 'out' not found
  Backtrace:
      ▆
   1. └─testthat::expect_gte(min(out$probability), 0 - 1e-12) at test-posterior_probs.R:17:3
   2.   └─testthat::quasi_label(enquo(object), label)
   3.     └─rlang::eval_bare(expr, quo_get_env(quo))
  ── Failure ('test-posterior_probs.R:35:3'): 'posterior_probs' works for 'nhmm' ──
  Expected `out <- posterior_probs(fit)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(out <- posterior_probs(fit), NA) at test-posterior_probs.R:35:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::posterior_probs(fit)
    8. └─seqHMM:::posterior_probs.nhmm(fit)
    9.   ├─...[]
   10.   └─data.table:::`[.data.table`(...)
  ── Error ('test-posterior_probs.R:39:3'): 'posterior_probs' works for 'nhmm' ───
  Error in `eval(code, test_env)`: object 'out' not found
  Backtrace:
      ▆
   1. └─testthat::expect_gte(min(out$probability), 0 - 1e-12) at test-posterior_probs.R:39:3
   2.   └─testthat::quasi_label(enquo(object), label)
   3.     └─rlang::eval_bare(expr, quo_get_env(quo))
  ── Failure ('test-posterior_probs.R:75:3'): 'posterior_probs' works for 'mnhmm' ──
  Expected `out <- posterior_probs(fit)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 6/6 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(out <- posterior_probs(fit), NA) at test-posterior_probs.R:75:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─seqHMM::posterior_probs(fit)
    8. └─seqHMM:::posterior_probs.mnhmm(fit)
    9.   ├─...[]
   10.   └─data.table:::`[.data.table`(...)
  ── Error ('test-posterior_probs.R:79:3'): 'posterior_probs' works for 'mnhmm' ──
  Error in `eval(code, test_env)`: object 'out' not found
  Backtrace:
      ▆
   1. └─testthat::expect_gte(min(out$probability), 0 - 1e-12) at test-posterior_probs.R:79:3
   2.   └─testthat::quasi_label(enquo(object), label)
   3.     └─rlang::eval_bare(expr, quo_get_env(quo))
  ── Error ('test-predict.R:66:3'): 'predict' works 'mnhmm' ──────────────────────
  Error in ``[.data.table`(out, , `:=`(ll, logSumExp(log_alpha[time_var == time_var[.N]])), by = id_var, env = list(id_var = id_var, time_var = time_var), showProgress = FALSE)`: attempt access index 6/6 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─seqHMM::bootstrap_coefs(fit, nsim = 5) at test-predict.R:66:3
   2. └─seqHMM:::bootstrap_coefs.mnhmm(fit, nsim = 5)
   3.   ├─base::matrix(...)
   4.   └─seqHMM::posterior_cluster_probabilities(model)
   5.     ├─seqHMM::posterior_probs(x)
   6.     └─seqHMM:::posterior_probs.mnhmm(x)
   7.       ├─...[]
   8.       └─data.table:::`[.data.table`(...)
  
  [ FAIL 24 | WARN 0 | SKIP 2 | PASS 302 ]
  Error:
  ! Test failures.
  Execution halted