Running 'testthat.R' [23s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > Sys.setenv("R_TESTS" = "")
  > library(testthat)
  > library(personalized)
  Loading required package: glmnet
  Loading required package: Matrix
  Loading required package: foreach
  Loaded glmnet 2.0-16
  
  Loading required package: mgcv
  Loading required package: nlme
  This is mgcv 1.8-24. For overview type 'help("mgcv-package")'.
  Loading required package: gbm
  Loaded gbm 2.1.4
  Loading required package: ggplot2
  Loading required package: plotly
  
  Attaching package: 'plotly'
  
  The following object is masked from 'package:ggplot2':
  
      last_plot
  
  The following object is masked from 'package:stats':
  
      filter
  
  The following object is masked from 'package:graphics':
  
      layout
  
  > 
  > test_check("personalized")
  -- 1. Error: test fit.subgroup for continuous outcomes and various losses (@test
  object 'all_losses' not found
  1: fit.subgroup(x = x, y = y, trt = trt01, propensity.func = prop.func, loss = "sq_loss_lasso", 
         nfolds = 5) at testthat/test-fitsubgroup.R:121
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 2. Error: test fit.subgroup for time-to-event outcomes and various losses (@t
  object 'all_losses' not found
  1: fit.subgroup(x = x, y = Surv(y.time.to.event, status), trt = trt01, propensity.func = prop.func, 
         loss = "cox_loss_lasso", nfolds = 5) at testthat/test-fitsubgroup.R:857
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 3. Error: test fit.subgroup with augment.func for continuous outcomes and var
  object 'all_losses' not found
  1: fit.subgroup(x = x, y = y, trt = trt01, augment.func = augment.func, propensity.func = prop.func, 
         loss = "sq_loss_lasso", nfolds = 5) at testthat/test-fitsubgroup.R:960
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 4. Error: test fit.subgroup for continuous outcomes with no propensity functi
  object 'all_losses' not found
  1: fit.subgroup(x = x, y = y, trt = trt01, loss = "sq_loss_lasso", nfolds = 5) at testthat/test-fitsubgroup.R:1159
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 5. Error: test fit.subgroup for binary outcomes and various losses (@test-fit
  object 'all_losses' not found
  1: fit.subgroup(x = x, y = y.binary, trt = trt01, propensity.func = prop.func, loss = "logistic_loss_lasso", 
         nfolds = 5) at testthat/test-fitsubgroup.R:1220
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 6. Error: test fit.subgroup for continuous outcomes and match.id provided (@t
  object 'all_losses' not found
  1: fit.subgroup(x = x.m, y = y.m, trt = trt.m, match.id = as.factor(match.id), loss = "sq_loss_lasso", 
         nfolds = 5) at testthat/test-fitsubgroup.R:1465
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 7. Error: test fit.subgroup for continuous outcomes and multiple trts and var
  object 'all_losses' not found
  1: fit.subgroup(x = x, y = y, trt = trt, propensity.func = propensity.multinom.lasso, 
         loss = "sq_loss_lasso", nfolds = 5) at testthat/test-fitsubgroup.R:1754
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 8. Error: test plotting for continuous outcomes with various options (@test-p
  object 'all_losses' not found
  1: fit.subgroup(x = x, y = y, trt = trt01, propensity.func = prop.func, loss = "sq_loss_lasso", 
         cutpoint = "median", nfolds = 5) at testthat/test-plotandplotcompare.R:47
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 9. Error: test that treatment effect calculations work (@test-treatmenteffect
  object 'all_losses' not found
  1: fit.subgroup(x = x, y = y, trt = trt01, propensity.func = prop.func, loss = "sq_loss_lasso", 
         nfolds = 5) at testthat/test-treatmenteffects.R:51
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 10. Error: test validate.subgroup for continuous outcomes with various option
  object 'all_losses' not found
  1: fit.subgroup(x = cbind(x, rbinom(n.obs, 1, 0.25)), y = y, trt = trt01, propensity.func = prop.func, 
         loss = "sq_loss_lasso", nfolds = 5) at testthat/test-validatesubgroup.R:47
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  -- 11. Error: test validate.subgroup for binary outcomes and various losses (@te
  object 'all_losses' not found
  1: fit.subgroup(x = x, y = y.binary, trt = trt01, propensity.func = prop.func, loss = "logistic_loss_lasso", 
         nfolds = 5) at testthat/test-validatesubgroup.R:147
  2: suppressWarnings(fitted.model$individual.trt.effects <- treat.effects(fitted.model$benefit.scores, 
         loss, method, pi.x))
  3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  4: treat.effects(fitted.model$benefit.scores, loss, method, pi.x)
  5: match.arg(loss)
  6: eval(formal.args[[as.character(substitute(arg))]])
  7: eval(formal.args[[as.character(substitute(arg))]])
  
  
  Hyperbolic Tangent kernel function. 
   Hyperparameters : scale =  1  offset =  1 
  
                                    
  C                    1.0000 10.000
  CV weighted accuracy 0.9138  0.919
  == testthat results  ===========================================================
  OK: 55 SKIPPED: 0 FAILED: 11
  1. Error: test fit.subgroup for continuous outcomes and various losses (@test-fitsubgroup.R#121) 
  2. Error: test fit.subgroup for time-to-event outcomes and various losses (@test-fitsubgroup.R#857) 
  3. Error: test fit.subgroup with augment.func for continuous outcomes and various losses (@test-fitsubgroup.R#960) 
  4. Error: test fit.subgroup for continuous outcomes with no propensity function specified (@test-fitsubgroup.R#1159) 
  5. Error: test fit.subgroup for binary outcomes and various losses (@test-fitsubgroup.R#1220) 
  6. Error: test fit.subgroup for continuous outcomes and match.id provided (@test-fitsubgroup.R#1465) 
  7. Error: test fit.subgroup for continuous outcomes and multiple trts and various losses (@test-fitsubgroup.R#1754) 
  8. Error: test plotting for continuous outcomes with various options (@test-plotandplotcompare.R#47) 
  9. Error: test that treatment effect calculations work (@test-treatmenteffects.R#51) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted