Running 'testthat.R' [38s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(casebase)
  See example usage at http://sahirbhatnagar.com/casebase/
  > library(data.table)
  > library(survival)
  > 
  > test_check("casebase")
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 85 
  Number of base moments: 8500 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DF, time = "ftime")
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.1501     0.1831   0.820    0.412    
  Z             0.9521     0.2280   4.175 2.97e-05 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 953.73  on 8584  degrees of freedom
  Residual deviance: 935.27  on 8583  degrees of freedom
  AIC: 939.27
  
  Number of Fisher Scoring iterations: 8
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 85 
  Number of base moments: 8500 
  ----
  
  Call:
  fitSmoothHazard(formula = event ~ Z, data = DT, time = "ftime")
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)   0.1677     0.1831   0.916     0.36    
  Z             0.9101     0.2280   3.992 6.56e-05 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 953.73  on 8584  degrees of freedom
  Residual deviance: 936.88  on 8583  degrees of freedom
  AIC: 940.88
  
  Number of Fisher Scoring iterations: 7
  
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 72 
  Number of base moments: 720 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept)  -0.3347     0.2336  -1.433    0.152    
  Z             1.3385     0.2784   4.808 1.52e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Approximate significance of smooth terms:
             edf Ref.df Chi.sq p-value  
  s(ftime) 6.626  7.689  14.95  0.0509 .
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  R-sq.(adj) =  0.049   Deviance explained = 9.21%
  UBRE = -0.42503  Scale est. = 1         n = 792
  Fitting smooth hazards with case-base sampling
  
  Sample size: 200 
  Number of events: 72 
  Number of base moments: 720 
  ----
  
  Family: binomial 
  Link function: logit 
  
  Formula:
  event ~ s(ftime) + Z + offset(offset)
  
  Parametric coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -56.5919    27.1502  -2.084   0.0371 *  
  Z             1.3693     0.2841   4.820 1.43e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Approximate significance of smooth terms:
             edf Ref.df Chi.sq p-value
  s(ftime) 8.805  8.963  10.03   0.345
  
  R-sq.(adj) =  0.0753   Deviance explained = 12.5%
  UBRE = -0.43965  Scale est. = 1         n = 792
  [ FAIL 1 | WARN 2 | SKIP 3 | PASS 234 ]
  
  ══ Skipped tests (3) ═══════════════════════════════════════════════════════════
  • gbm cannot be loaded (2): 'test-plotHazard.R:3:1',
    'test-plotSingleEventCB.R:3:1'
  • gbm not implemented (1): 'test-gbm.R:2:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-gam.R:81:5'): should compute risk when time and newdata aren't provided ──
  Error in `integrate(hazard, lower = 0, upper = time_vector[j], fit = object, 
      subdivisions = nsamp, newdata = newdata[j, , drop = FALSE], 
      s = s, n.trees = n.trees)`: non-finite function value
  Backtrace:
      ▆
   1. └─casebase::absoluteRisk(fitDT_gam) at test-gam.R:81:5
   2.   └─casebase:::estimate_risk(...)
   3.     └─base::sapply(...)
   4.       └─base::lapply(X = X, FUN = FUN, ...)
   5.         └─casebase (local) FUN(X[[i]], ...)
   6.           └─stats::integrate(...)
  
  [ FAIL 1 | WARN 2 | SKIP 3 | PASS 234 ]
  Error: Test failures
  Execution halted