Running ‘testthat.R’ [8s/14s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ssc)
  > 
  > test_check("ssc")
  ── 1. Error: democratic works (@test_Democratic.R#9)  ──────────────────────────
  object 'knn3' not found
  Backtrace:
   1. ssc::democratic(...)
   2. ssc:::as.list2(learners.pars, length(learners))
  
  ── 2. Error: the learners information is complete (@test_Democratic.R#56)  ─────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::democratic(...)
   5. ssc:::as.list2(learners.pars, length(learners))
  
  ── 3. Error: prediction not fail when x is a vector (@test_Democratic.R#65)  ───
  object 'knn3' not found
  Backtrace:
   1. ssc::democratic(...)
   2. ssc:::as.list2(learners.pars, length(learners))
  
  ── 4. Error: the model structure is correct (@test_Democratic.R#76)  ───────────
  object 'knn3' not found
  Backtrace:
   1. ssc::democratic(...)
   2. ssc:::as.list2(learners.pars, length(learners))
  
  ── 5. Error: x can be a data.frame (@test_Democratic.R#89)  ────────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::democratic(...)
   5. ssc:::as.list2(learners.pars, length(learners))
  
  ── 6. Error: y can be a vector (@test_Democratic.R#100)  ───────────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::democratic(...)
   5. ssc:::as.list2(learners.pars, length(learners))
  
  ── 7. Error: x.inst can be coerced to logical (@test_Democratic.R#111)  ────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::democratic(...)
   5. ssc:::as.list2(learners.pars, length(learners))
  
  ── 8. Error: x is a square matrix when x.inst is FALSE (@test_Democratic.R#165) 
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::democratic(...)
   5. ssc:::as.list2(learners.pars, length(learners))
  
  ── 9. Error: (unknown) (@test_DemocraticG.R#5)  ────────────────────────────────
  there is no package called 'caret'
  Backtrace:
   1. base::library(caret)
  
  ── 10. Error: setred works (@test_SETRED.R#9)  ─────────────────────────────────
  object 'knn3' not found
  Backtrace:
   1. ssc::setred(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::setredG(...)
   3. ssc:::gen.learner(labeled, ynew[labeled])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 11. Error: prediction not fail when x is a vector (@test_SETRED.R#28)  ──────
  object 'knn3' not found
  Backtrace:
   1. ssc::setred(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::setredG(...)
   3. ssc:::gen.learner(labeled, ynew[labeled])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 12. Error: the model structure is correct (@test_SETRED.R#38)  ──────────────
  object 'knn3' not found
  Backtrace:
   1. ssc::setred(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::setredG(...)
   3. ssc:::gen.learner(labeled, ynew[labeled])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 13. Error: x can be a data.frame (@test_SETRED.R#49)  ───────────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::setred(...)
   5. ssc::setredG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 14. Error: y can be a vector (@test_SETRED.R#59)  ───────────────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::setred(x = wine$xtrain, y = as.vector(wine$ytrain), learner = knn3)
   5. ssc::setredG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 15. Error: x.inst can be coerced to logical (@test_SETRED.R#69)  ────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::setred(...)
   5. ssc::setredG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 16. Error: x is a square matrix when x.inst is FALSE (@test_SETRED.R#119)  ──
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::setred(...)
   5. ssc::setredG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(...)
   8. base::do.call(learner, lpars)
  
  ── 17. Error: max.iter is a value greather than 0 (@test_SETRED.R#135)  ────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::setred(...)
   5. ssc::setredG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 18. Error: perc.full is a value between 0 and 1 (@test_SETRED.R#151)  ───────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::setred(...)
   5. ssc::setredG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 19. Error: theta is a value between 0 and 1 (@test_SETRED.R#167)  ───────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::setred(...)
   5. ssc::setredG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 20. Error: selfTraining works (@test_SelfTraining.R#9)  ─────────────────────
  object 'knn3' not found
  Backtrace:
   1. ssc::selfTraining(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::selfTrainingG(...)
   3. ssc:::gen.learner(labeled, ynew[labeled])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 21. Error: prediction not fail when x is a vector (@test_SelfTraining.R#29)  
  object 'knn3' not found
  Backtrace:
   1. ssc::selfTraining(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::selfTrainingG(...)
   3. ssc:::gen.learner(labeled, ynew[labeled])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 22. Error: the model structure is correct (@test_SelfTraining.R#39)  ────────
  object 'knn3' not found
  Backtrace:
   1. ssc::selfTraining(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::selfTrainingG(...)
   3. ssc:::gen.learner(labeled, ynew[labeled])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 23. Error: x can be a data.frame (@test_SelfTraining.R#51)  ─────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::selfTraining(x, y = wine$ytrain, learner = knn3)
   5. ssc::selfTrainingG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 24. Error: y can be a vector (@test_SelfTraining.R#60)  ─────────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::selfTraining(x = wine$xtrain, y, learner = knn3)
   5. ssc::selfTrainingG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 25. Error: x.inst can be coerced to logical (@test_SelfTraining.R#68)  ──────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::selfTraining(...)
   5. ssc::selfTrainingG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 26. Error: x is a square matrix when x.inst is FALSE (@test_SelfTraining.R#11
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::selfTraining(...)
   5. ssc::selfTrainingG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(...)
   8. base::do.call(learner, lpars)
  
  ── 27. Error: max.iter is a value greather than 0 (@test_SelfTraining.R#130)  ──
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::selfTraining(...)
   5. ssc::selfTrainingG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 28. Error: perc.full is a value between 0 and 1 (@test_SelfTraining.R#146)  ─
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::selfTraining(...)
   5. ssc::selfTrainingG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 29. Error: thr.conf is a value between 0 and 1 (@test_SelfTraining.R#162)  ──
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::selfTraining(...)
   5. ssc::selfTrainingG(...)
   6. ssc:::gen.learner(labeled, ynew[labeled])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 30. Error: triTraining works (@test_TriTraining.R#9)  ───────────────────────
  object 'knn3' not found
  Backtrace:
   1. ssc::triTraining(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::triTrainingG(y, gen.learner2, gen.pred2)
   3. ssc:::gen.learner(indexes, y[indexes])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 31. Error: prediction not fail when x is a vector (@test_TriTraining.R#28)  ─
  object 'knn3' not found
  Backtrace:
   1. ssc::triTraining(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::triTrainingG(y, gen.learner2, gen.pred2)
   3. ssc:::gen.learner(indexes, y[indexes])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 32. Error: the model structure is correct (@test_TriTraining.R#38)  ─────────
  object 'knn3' not found
  Backtrace:
   1. ssc::triTraining(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::triTrainingG(y, gen.learner2, gen.pred2)
   3. ssc:::gen.learner(indexes, y[indexes])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 33. Error: x can be a data.frame (@test_TriTraining.R#50)  ──────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::triTraining(...)
   5. ssc::triTrainingG(y, gen.learner2, gen.pred2)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 34. Error: y can be a vector (@test_TriTraining.R#60)  ──────────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::triTraining(...)
   5. ssc::triTrainingG(y, gen.learner2, gen.pred2)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 35. Error: x.inst can be coerced to logical (@test_TriTraining.R#70)  ───────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::triTraining(...)
   5. ssc::triTrainingG(y, gen.learner2, gen.pred2)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 36. Error: x is a square matrix when x.inst is FALSE (@test_TriTraining.R#120
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::triTraining(...)
   5. ssc::triTrainingG(y, gen.learner1, gen.pred1)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(...)
   8. base::do.call(learner, lpars)
  
  ── 37. Error: (unknown) (@test_TriTrainingG.R#4)  ──────────────────────────────
  there is no package called 'caret'
  Backtrace:
   1. base::library(caret)
  
  ── 38. Error: coBC works (@test_coBC.R#9)  ─────────────────────────────────────
  object 'knn3' not found
  Backtrace:
   1. ssc::coBC(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   3. ssc:::gen.learner(indexes, y[indexes])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 39. Error: prediction not fail when x is a vector (@test_coBC.R#28)  ────────
  object 'knn3' not found
  Backtrace:
   1. ssc::coBC(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   3. ssc:::gen.learner(indexes, y[indexes])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 40. Error: the model structure is correct (@test_coBC.R#38)  ────────────────
  object 'knn3' not found
  Backtrace:
   1. ssc::coBC(x = wine$xtrain, y = wine$ytrain, learner = knn3)
   2. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   3. ssc:::gen.learner(indexes, y[indexes])
   4. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   5. base::do.call(learner, lpars)
  
  ── 41. Error: x can be a data.frame (@test_coBC.R#50)  ─────────────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::coBC(x = as.data.frame(wine$xtrain), y = wine$ytrain, learner = knn3)
   5. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 42. Error: y can be a vector (@test_coBC.R#60)  ─────────────────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::coBC(x = wine$xtrain, y = as.vector(wine$ytrain), learner = knn3)
   5. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 43. Error: x.inst can be coerced to logical (@test_coBC.R#70)  ──────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::coBC(x = wine$xtrain, y = wine$ytrain, x.inst = TRUE, learner = knn3)
   5. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 44. Error: x is a square matrix when x.inst is FALSE (@test_coBC.R#120)  ────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::coBC(x = wine$dtrain, y = wine$ytrain, x.inst = FALSE, learner = knn3)
   5. ssc::coBCG(y, gen.learner1, gen.pred1, N, perc.full, u, max.iter)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(...)
   8. base::do.call(learner, lpars)
  
  ── 45. Error: max.iter is a value greather than 0 (@test_coBC.R#136)  ──────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::coBC(x = wine$xtrain, y = wine$ytrain, learner = knn3, max.iter = 80)
   5. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 46. Error: perc.full is a value between 0 and 1 (@test_coBC.R#152)  ─────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::coBC(x = wine$xtrain, y = wine$ytrain, learner = knn3, perc.full = 0.8)
   5. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 47. Error: N is a value greather than 0 (@test_coBC.R#169)  ─────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::coBC(x = wine$xtrain, y = wine$ytrain, learner = knn3, N = 2)
   5. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 48. Error: u is a value greather than 0 (@test_coBC.R#185)  ─────────────────
  object 'knn3' not found
  Backtrace:
   1. testthat::expect_is(...)
   4. ssc::coBC(x = wine$xtrain, y = wine$ytrain, learner = knn3, u = 80)
   5. ssc::coBCG(y, gen.learner2, gen.pred2, N, perc.full, u, max.iter)
   6. ssc:::gen.learner(indexes, y[indexes])
   7. ssc:::trainModel(x[training.ints, ], cls, learner, learner.pars)
   8. base::do.call(learner, lpars)
  
  ── 49. Error: (unknown) (@test_coBCG.R#4)  ─────────────────────────────────────
  there is no package called 'caret'
  Backtrace:
   1. base::library(caret)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 89 | SKIPPED: 0 | WARNINGS: 5 | FAILED: 49 ]
  1. Error: democratic works (@test_Democratic.R#9) 
  2. Error: the learners information is complete (@test_Democratic.R#56) 
  3. Error: prediction not fail when x is a vector (@test_Democratic.R#65) 
  4. Error: the model structure is correct (@test_Democratic.R#76) 
  5. Error: x can be a data.frame (@test_Democratic.R#89) 
  6. Error: y can be a vector (@test_Democratic.R#100) 
  7. Error: x.inst can be coerced to logical (@test_Democratic.R#111) 
  8. Error: x is a square matrix when x.inst is FALSE (@test_Democratic.R#165) 
  9. Error: (unknown) (@test_DemocraticG.R#5) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted