Running ‘testthat.R’ [147s/188s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(scoringTools)
  > 
  > test_check("scoringTools")
  ── 1. Error: mdlp method works with speedglm and glm (@test-mdlp.R#18)  ────────
  contrasts can be applied only to factors with 2 or more levels
  Backtrace:
    1. scoringTools::mdlp_iter(...)
    6. speedglm:::predict.speedglm(best.disc[[1]], data_test, type = "response")
    7. speedglm:::predict.speedlm(...)
    9. stats::model.matrix.default(Terms, m, contrasts.arg = object$contrasts)
   10. stats::`contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]])
  
  Generalized Linear Model of class 'speedglm':
  
  Call:  speedglm::speedglm(formula = labels ~ ., data = df_augmente[,      -which(names(df_augmente) %in% c("poidsfinal", "classe_SCORE"))][!df_augmente$poidsfinal ==      0, ], family = stats::binomial(link = "logit"), weights = df_augmente$poidsfinal[!df_augmente$poidsfinal ==      0]) 
  
  Coefficients:
  (Intercept)          x.1          x.2  
        2.127       -0.373       -2.834  
  
  Generalized Linear Model of class 'speedglm':
  
  Call:  speedglm::speedglm(formula = stats::formula("labels ~ ."), data = Filter(function(x) (length(unique(x)) >      1), data.frame(sapply(disc[[i]]$Disc.data, as.factor), stringsAsFactors = TRUE)),      family = stats::binomial(link = "logit"), weights = NULL,      fitted = TRUE) 
  
  Coefficients:
  (Intercept)          X12          X32          X33  
       -0.313       -2.263        2.198       -0.522  
  
  Generalized Linear Model of class 'speedglm':
  
  Call:  speedglm::speedglm(formula = stats::formula("labels ~ ."), data = Filter(function(x) (length(unique(x)) >      1), data.frame(sapply(disc[[i]]$Disc.data, as.factor), stringsAsFactors = TRUE)),      family = stats::binomial(link = "logit"), weights = NULL,      fitted = TRUE) 
  
  Coefficients:
  (Intercept)          X12          X32          X33  
       -0.313       -2.263        2.198       -0.522  
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 447 | SKIPPED: 0 | WARNINGS: 10 | FAILED: 1 ]
  1. Error: mdlp method works with speedglm and glm (@test-mdlp.R#18) 
  
  Error: testthat unit tests failed
  Execution halted