Running ‘testthat.R’ [17s/22s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(OncoBayes2)
  Loading required package: Rcpp
  This is OncoBayes2 version 0.6.0
  > 
  > test_check("OncoBayes2")
  Loading required package: StanHeaders
  Loading required package: ggplot2
  rstan (Version 2.19.3, GitRev: 2e1f913d3ca3)
  For execution on a local, multicore CPU with excess RAM we recommend calling
  options(mc.cores = parallel::detectCores()).
  To avoid recompilation of unchanged Stan programs, we recommend calling
  rstan_options(auto_write = TRUE)
  
  Attaching package: 'tibble'
  
  The following object is masked from 'package:assertthat':
  
      has_name
  
  
  Attaching package: 'tidyr'
  
  The following object is masked from 'package:rstan':
  
      extract
  
  The following object is masked from 'package:testthat':
  
      matches
  
  
  Attaching package: 'dplyr'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  ── 1. Failure: update.blrmfit grows the data set (@test-blrm_exnex.R#235)  ─────
  `new_blrmfit_3 <- with(combo2_new, update(blrmfit, add_data = new_codata))` did not throw an error.
  
  ── 2. Error: update.blrmfit does regular updating (@test-blrm_exnex.R#301)  ────
  object 'group_index' not found
  Backtrace:
    1. base::with(single_agent_new, update(blrmfit, data = only_cohort_SA))
    2. base::with.default(single_agent_new, update(blrmfit, data = only_cohort_SA))
    3. [ base::eval(...) ] with 1 more call
    6. OncoBayes2:::update.blrmfit(blrmfit, data = only_cohort_SA)
    7. [ base::eval(...) ] with 1 more call
    9. OncoBayes2::blrm_exnex(...)
   10. base::factor(group_index)
  
  Bayesian Logistic Regression Model trial with 
  
  Number of observations   : 4 
  Number of historic groups: 2 
  Number of trial arms     : 2 
  Generated formula        :
   cbind(num_toxicities, num_patients - num_toxicities) ~
   1 + I(log(drug1/1)) |
   0 |
   stratum_id / group_id 
  
  BLRM prior undefined!
  Bayesian Logistic Regression Model trial with 
  
  Number of observations   : 4 
  Number of historic groups: 2 
  Number of trial arms     : 2 
  Generated formula        :
   cbind(num_toxicities, num_patients - num_toxicities) ~
   1 + I(log(drug1/1)) |
   0 |
   stratum_id / group_id 
  
  Bayesian Logistic Regression Model with EXchangeability-NonEXchangeability
  
  Number of observations: 6 
  Number of groups      : 4 
  Number of strata      : 1 
  Number of components  : 1 
  Number of interactions: 0 
  EXNEX components      : 1 
  EXNEX interactions    : 0 
  
  Observations per group:
     Group n Stratum n_total
  1 hist_A 2     all       6
  2 hist_B 2     all       6
  3  cur_A 1     all       0
  4  cur_B 1     all       0
  
  Groups per stratum:
    Stratum Groups n_total
  1     all      4      12
  
  Component posterior:
  Population mean posterior mu_log_beta
  intercept:
     mean se_mean      sd    2.5%     50%   97.5%   n_eff    Rhat 
     -2.7     1.5     1.2    -3.5    -2.7    -2.0     0.6     Inf 
  log-slope:
     mean se_mean      sd    2.5%     50%   97.5%   n_eff    Rhat 
   -0.440   0.704   0.547  -0.807  -0.440  -0.072   0.602     Inf 
  
  Population heterogeniety posterior tau_log_beta
  intercept:
     mean se_mean      sd    2.5%     50%   97.5%   n_eff    Rhat 
     0.74    1.02    0.79    0.21    0.74    1.27    0.60     Inf 
  log-slope:
     mean se_mean      sd    2.5%     50%   97.5%   n_eff    Rhat 
   0.2644  0.0024  0.0019  0.2631  0.2644  0.2657  0.6021     Inf 
  
  Population correlation posterior rho_log_beta
                   mean se_mean   sd  2.5%   50% 97.5% n_eff Rhat
  I(log(drug1/1)) 0.088    0.44 0.34 -0.14 0.088  0.32   0.6  Inf
  
  No interaction model posterior specified.
  Error in na.fail.default(X[[i]], ...) : missing values in object
  Bayesian Logistic Regression Model trial with 
  
  Number of observations   : 1 
  Number of historic groups: 1 
  Number of trial arms     : 1 
  Generated formula        :
   cbind(num_toxicities, num_patients - num_toxicities) ~
   1 + I(log(A/1)) |
   1 + I(log(B/1)) |
   1 + I(log(C/1)) |
   0 + I(A/1 * B/1) + I(A/1 * C/1) + I(B/1 * C/1) |
   stratum_id / group_id 
  
  BLRM prior undefined!
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 134 | SKIPPED: 4 | WARNINGS: 137 | FAILED: 2 ]
  1. Failure: update.blrmfit grows the data set (@test-blrm_exnex.R#235) 
  2. Error: update.blrmfit does regular updating (@test-blrm_exnex.R#301) 
  
  Error: testthat unit tests failed
  Execution halted