Running ‘testthat.R’ [21s/31s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(rxode2)
  rxode2 5.0.1 using 3 threads (see ?getRxThreads)
    no cache: create with `rxCreateCache()`
  > library(posologyr)
  > library(testthat)
  > setRxThreads(2L) #for CRAN, following the advice of mattfidler
  > 
  > test_check("posologyr")
  Saving _problems/test_doseoptim-108.R
  Saving _problems/test_doseoptim-218.R
  Saving _problems/test_doseoptim_cmt-60.R
  Saving _problems/test_doseoptim_tdm-53.R
  Saving _problems/test_doseoptim_tdm-82.R
  Saving _problems/test_doseoptim_tdm-112.R
  Saving _problems/test_issue_10-41.R
  Saving _problems/test_issue_10-49.R
  Saving _problems/test_issue_28-60.R
  Saving _problems/test_issue_29-53.R
  Saving _problems/test_issue_30-50.R
  Saving _problems/test_issue_32-60.R
  Saving _problems/test_issue_52-37.R
  Saving _problems/test_map_iov-64.R
  Saving _problems/test_map_mlx-78.R
  Saving _problems/test_map_nlmixr-42.R
  Saving _problems/test_map_nm-51.R
  Saving _problems/test_rxui-39.R
  [ FAIL 18 | WARN 0 | SKIP 4 | PASS 10 ]
  
  ══ Skipped tests (4) ═══════════════════════════════════════════════════════════
  • On CRAN (2): 'test_rxui.R:48:3', 'test_rxui.R:128:3'
  • empty test (2): ,
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_doseoptim.R:97:3'): Same optimal dose with or without providing MAP estimates ──
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 18/18 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_equal(...) at test_doseoptim.R:97:3
    2. │ └─testthat::quasi_label(enquo(expected), expected.label)
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. └─posologyr::poso_dose_conc(...)
    5.   └─posologyr:::read_optim_distribution_input(...)
    6.     └─posologyr::poso_estim_map(dat, prior_model, nocb = nocb, return_model = TRUE)
    7.       └─posologyr:::init_eta(...)
    8.         └─posologyr:::residual_error_all_endpoints(...)
    9.           ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   10.           └─data.table:::`[.data.table`(...)
  ── Error ('test_doseoptim.R:211:3'): Optimization results do not deviate from known values
            for multiple dose regimen ──
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 22/22 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_equal(...) at test_doseoptim.R:211:3
    2. │ └─testthat::quasi_label(enquo(object), label)
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. └─posologyr::poso_time_cmin(...)
    5.   └─posologyr:::read_optim_distribution_input(...)
    6.     └─posologyr::poso_estim_map(dat, prior_model, nocb = nocb, return_model = TRUE)
    7.       └─posologyr:::init_eta(...)
    8.         └─posologyr:::residual_error_all_endpoints(...)
    9.           ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   10.           └─data.table:::`[.data.table`(...)
  ── Error ('test_doseoptim_cmt.R:57:3'): Optimal dose can be estimated for dosing in any compartment ──
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 26/26 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test_doseoptim_cmt.R:57:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─posologyr::poso_dose_conc(...)
   5.   └─posologyr::poso_estim_map(...)
   6.     └─posologyr:::init_eta(...)
   7.       └─posologyr:::residual_error_all_endpoints(...)
   8.         ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test_doseoptim_tdm.R:49:3'): Optimization results do not deviate from known values
            following TDM events when the last time is a float number ──
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 23/23 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test_doseoptim_tdm.R:49:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─posologyr::poso_time_cmin(...)
   5.   └─posologyr::poso_estim_map(...)
   6.     └─posologyr:::init_eta(...)
   7.       └─posologyr:::residual_error_all_endpoints(...)
   8.         ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test_doseoptim_tdm.R:78:13'): Optimization results do not deviate from known values
            following TDM events when the last time is an integer ──
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 23/23 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test_doseoptim_tdm.R:78:13
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─posologyr::poso_time_cmin(...)
   5.   └─posologyr::poso_estim_map(...)
   6.     └─posologyr:::init_eta(...)
   7.       └─posologyr:::residual_error_all_endpoints(...)
   8.         ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test_doseoptim_tdm.R:109:13'): The functions issue a warning when parameters are ignored because
            TDM=true ──
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 23/23 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test_doseoptim_tdm.R:109:13
    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. └─posologyr::poso_time_cmin(...)
    8.   └─posologyr::poso_estim_map(...)
    9.     └─posologyr:::init_eta(...)
   10.       └─posologyr:::residual_error_all_endpoints(...)
   11.         ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   12.         └─data.table:::`[.data.table`(...)
  ── Error ('test_issue_10.R:38:3'): poso_mcmc_pop accepts burn_in == n_iter ─────
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test_issue_10.R:38:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─posologyr::poso_estim_mcmc(...)
   5.   └─base::lapply(...)
   6.     └─posologyr (local) FUN(X[[i]], ...)
   7.       └─posologyr:::residual_error_all_endpoints(...)
   8.         ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test_issue_10.R:45:3'): poso_mcmc_pop accepts burn_in < n_iter ──────
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test_issue_10.R:45:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─posologyr::poso_estim_mcmc(...)
   5.   └─base::lapply(...)
   6.     └─posologyr (local) FUN(X[[i]], ...)
   7.       └─posologyr:::residual_error_all_endpoints(...)
   8.         ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   9.         └─data.table:::`[.data.table`(...)
  ── Error ('test_issue_28.R:56:3'): poso_estim_map provides estimates even when predicted concentrations
            are zero ──
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 17/17 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test_issue_28.R:56:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─posologyr::poso_estim_map(...)
   5.   └─posologyr:::init_eta(...)
   6.     └─posologyr:::residual_error_all_endpoints(...)
   7.       ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   8.       └─data.table:::`[.data.table`(...)
  ── Error ('test_issue_29.R:49:3'): poso_estim_map provides estimates even when the IIV is zero ──
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 16/16 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test_issue_29.R:49:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─posologyr::poso_estim_map(...)
   5.   └─posologyr:::init_eta(...)
   6.     └─posologyr:::residual_error_all_endpoints(...)
   7.       ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   8.       └─data.table:::`[.data.table`(...)
  ── Error ('test_issue_30.R:50:1'): (code run outside of `test_that()`) ─────────
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 22/22 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─posologyr::poso_estim_map(df_patientA_tdm, mod_MTXHD_joerger2011) at test_issue_30.R:50:1
   2.   └─posologyr:::init_eta(...)
   3.     └─posologyr:::residual_error_all_endpoints(...)
   4.       ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   5.       └─data.table:::`[.data.table`(...)
  ── Error ('test_issue_32.R:55:3'): Dosing optim functions can use models with IOV ──
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 26/26 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_equal(...) at test_issue_32.R:55:3
    2. │ └─testthat::quasi_label(enquo(object), label)
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. └─posologyr::poso_time_cmin(...)
    5.   └─posologyr:::read_optim_distribution_input(...)
    6.     └─posologyr::poso_estim_map(dat, prior_model, nocb = nocb, return_model = TRUE)
    7.       └─posologyr:::init_eta(...)
    8.         └─posologyr:::residual_error_all_endpoints(...)
    9.           ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   10.           └─data.table:::`[.data.table`(...)
  ── Error ('test_issue_52.R:37:3'): single IIV ──────────────────────────────────
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 16/16 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─posologyr::poso_estim_map(patient_data, mod_run001) at test_issue_52.R:37:3
   2.   └─posologyr:::init_eta(...)
   3.     └─posologyr:::residual_error_all_endpoints(...)
   4.       ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   5.       └─data.table:::`[.data.table`(...)
  ── Error ('test_map_iov.R:62:1'): (code run outside of `test_that()`) ──────────
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 26/26 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─posologyr::poso_estim_map(...) at test_map_iov.R:62:1
   2.   └─posologyr:::init_eta(...)
   3.     └─posologyr:::residual_error_all_endpoints(...)
   4.       ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   5.       └─data.table:::`[.data.table`(...)
  ── Error ('test_map_mlx.R:76:1'): (code run outside of `test_that()`) ──────────
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 18/18 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─posologyr::poso_estim_map(...) at test_map_mlx.R:76:1
   2.   └─posologyr:::init_eta(...)
   3.     └─posologyr:::residual_error_all_endpoints(...)
   4.       ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   5.       └─data.table:::`[.data.table`(...)
  ── Error ('test_map_nlmixr.R:40:1'): (code run outside of `test_that()`) ───────
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 22/22 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─posologyr::poso_estim_map(...) at test_map_nlmixr.R:40:1
   2.   └─posologyr:::init_eta(...)
   3.     └─posologyr:::residual_error_all_endpoints(...)
   4.       ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   5.       └─data.table:::`[.data.table`(...)
  ── Error ('test_map_nm.R:49:1'): (code run outside of `test_that()`) ───────────
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 17/17 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─posologyr::poso_estim_map(...) at test_map_nm.R:49:1
   2.   └─posologyr:::init_eta(...)
   3.     └─posologyr:::residual_error_all_endpoints(...)
   4.       ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   5.       └─data.table:::`[.data.table`(...)
  ── Error ('test_rxui.R:39:3'): readme model equivalent ─────────────────────────
  Error in ``[.data.table`(f_all_endpoints, , `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints)))`: attempt access index 16/16 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─posologyr::poso_estim_map(patient_data, mod_run001) at test_rxui.R:39:3
   2.   └─posologyr:::init_eta(...)
   3.     └─posologyr:::residual_error_all_endpoints(...)
   4.       ├─f_all_endpoints[, `:=`(f, get(as.character(DVID))), by = seq_len(nrow(f_all_endpoints))]
   5.       └─data.table:::`[.data.table`(...)
  
  [ FAIL 18 | WARN 0 | SKIP 4 | PASS 10 ]
  Error:
  ! Test failures.
  Execution halted