Running ‘testthat.R’ [14s/17s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(YPBP)
  Loading required package: survival
  
  Attaching package: 'YPBP'
  
  The following object is masked from 'package:stats':
  
      confint
  
  > 
  > test_check("YPBP")
  
  SAMPLING FOR MODEL 'ypbp' NOW (CHAIN 1).
  Chain 1: 
  Chain 1: Gradient evaluation took 0.000136 seconds
  Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 1.36 seconds.
  Chain 1: Adjust your expectations accordingly!
  Chain 1: 
  Chain 1: 
  Chain 1: Iteration:   1 / 500 [  0%]  (Warmup)
  Chain 1: Iteration:  50 / 500 [ 10%]  (Warmup)
  Chain 1: Iteration: 100 / 500 [ 20%]  (Warmup)
  Chain 1: Iteration: 150 / 500 [ 30%]  (Warmup)
  Chain 1: Iteration: 200 / 500 [ 40%]  (Warmup)
  Chain 1: Iteration: 250 / 500 [ 50%]  (Warmup)
  Chain 1: Iteration: 251 / 500 [ 50%]  (Sampling)
  Chain 1: Iteration: 300 / 500 [ 60%]  (Sampling)
  Chain 1: Iteration: 350 / 500 [ 70%]  (Sampling)
  Chain 1: Iteration: 400 / 500 [ 80%]  (Sampling)
  Chain 1: Iteration: 450 / 500 [ 90%]  (Sampling)
  Chain 1: Iteration: 500 / 500 [100%]  (Sampling)
  Chain 1: 
  Chain 1:  Elapsed Time: 0.831 seconds (Warm-up)
  Chain 1:                0.518 seconds (Sampling)
  Chain 1:                1.349 seconds (Total)
  Chain 1: 
  
  SAMPLING FOR MODEL 'ypbp' NOW (CHAIN 2).
  Chain 2: 
  Chain 2: Gradient evaluation took 6.6e-05 seconds
  Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.66 seconds.
  Chain 2: Adjust your expectations accordingly!
  Chain 2: 
  Chain 2: 
  Chain 2: Iteration:   1 / 500 [  0%]  (Warmup)
  Chain 2: Iteration:  50 / 500 [ 10%]  (Warmup)
  Chain 2: Iteration: 100 / 500 [ 20%]  (Warmup)
  Chain 2: Iteration: 150 / 500 [ 30%]  (Warmup)
  Chain 2: Iteration: 200 / 500 [ 40%]  (Warmup)
  Chain 2: Iteration: 250 / 500 [ 50%]  (Warmup)
  Chain 2: Iteration: 251 / 500 [ 50%]  (Sampling)
  Chain 2: Iteration: 300 / 500 [ 60%]  (Sampling)
  Chain 2: Iteration: 350 / 500 [ 70%]  (Sampling)
  Chain 2: Iteration: 400 / 500 [ 80%]  (Sampling)
  Chain 2: Iteration: 450 / 500 [ 90%]  (Sampling)
  Chain 2: Iteration: 500 / 500 [100%]  (Sampling)
  Chain 2: 
  Chain 2:  Elapsed Time: 0.658 seconds (Warm-up)
  Chain 2:                0.595 seconds (Sampling)
  Chain 2:                1.253 seconds (Total)
  Chain 2: 
  
  SAMPLING FOR MODEL 'ypbp' NOW (CHAIN 1).
  Chain 1: 
  Chain 1: Gradient evaluation took 7.8e-05 seconds
  Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.78 seconds.
  Chain 1: Adjust your expectations accordingly!
  Chain 1: 
  Chain 1: 
  Chain 1: Iteration:   1 / 500 [  0%]  (Warmup)
  Chain 1: Iteration:  50 / 500 [ 10%]  (Warmup)
  Chain 1: Iteration: 100 / 500 [ 20%]  (Warmup)
  Chain 1: Iteration: 150 / 500 [ 30%]  (Warmup)
  Chain 1: Iteration: 200 / 500 [ 40%]  (Warmup)
  Chain 1: Iteration: 250 / 500 [ 50%]  (Warmup)
  Chain 1: Iteration: 251 / 500 [ 50%]  (Sampling)
  Chain 1: Iteration: 300 / 500 [ 60%]  (Sampling)
  Chain 1: Iteration: 350 / 500 [ 70%]  (Sampling)
  Chain 1: Iteration: 400 / 500 [ 80%]  (Sampling)
  Chain 1: Iteration: 450 / 500 [ 90%]  (Sampling)
  Chain 1: Iteration: 500 / 500 [100%]  (Sampling)
  Chain 1: 
  Chain 1:  Elapsed Time: 0.588 seconds (Warm-up)
  Chain 1:                0.449 seconds (Sampling)
  Chain 1:                1.037 seconds (Total)
  Chain 1: 
  
  SAMPLING FOR MODEL 'ypbp' NOW (CHAIN 2).
  Chain 2: 
  Chain 2: Gradient evaluation took 4.6e-05 seconds
  Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.46 seconds.
  Chain 2: Adjust your expectations accordingly!
  Chain 2: 
  Chain 2: 
  Chain 2: Iteration:   1 / 500 [  0%]  (Warmup)
  Chain 2: Iteration:  50 / 500 [ 10%]  (Warmup)
  Chain 2: Iteration: 100 / 500 [ 20%]  (Warmup)
  Chain 2: Iteration: 150 / 500 [ 30%]  (Warmup)
  Chain 2: Iteration: 200 / 500 [ 40%]  (Warmup)
  Chain 2: Iteration: 250 / 500 [ 50%]  (Warmup)
  Chain 2: Iteration: 251 / 500 [ 50%]  (Sampling)
  Chain 2: Iteration: 300 / 500 [ 60%]  (Sampling)
  Chain 2: Iteration: 350 / 500 [ 70%]  (Sampling)
  Chain 2: Iteration: 400 / 500 [ 80%]  (Sampling)
  Chain 2: Iteration: 450 / 500 [ 90%]  (Sampling)
  Chain 2: Iteration: 500 / 500 [100%]  (Sampling)
  Chain 2: 
  Chain 2:  Elapsed Time: 0.42 seconds (Warm-up)
  Chain 2:                0.382 seconds (Sampling)
  Chain 2:                0.802 seconds (Total)
  Chain 2: 
  Saving _problems/test_mle-8.R
  [ FAIL 1 | WARN 4 | SKIP 1 | PASS 0 ]
  
  ══ Skipped tests (1) ═══════════════════════════════════════════════════════════
  • empty test (1):
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_mle.R:8:1'): (code run outside of `test_that()`) ───────────────
  Error in `optimHess(theta, fn, gr, control = list(fnscale = -1))`: non-finite value supplied by optim
  Backtrace:
      ▆
   1. └─YPBP::ypbp(Surv(time, status) ~ trt, data = gastric, baseline = "odds") at test_mle.R:8:1
   2.   └─YPBP:::ypbp.mle(...)
   3.     ├─rstan::optimizing(...)
   4.     └─rstan::optimizing(...)
   5.       └─rstan (local) .local(object, ...)
   6.         └─stats::optimHess(theta, fn, gr, control = list(fnscale = -1))
  
  [ FAIL 1 | WARN 4 | SKIP 1 | PASS 0 ]
  Error:
  ! Test failures.
  Execution halted