Running ‘testthat.R’ [43s/47s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(VIM)
  Loading required package: colorspace
  Loading required package: grid
  Loading required package: data.table
  VIM is ready to use. 
   Since version 4.0.0 the GUI is in its own package VIMGUI.
  
            Please use the package to use the new (and old) GUI.
  
  Suggestions and bug-reports can be submitted at: https://github.com/alexkowa/VIM/issues
  
  Attaching package: 'VIM'
  
  The following object is masked from 'package:datasets':
  
      sleep
  
  > test_check("VIM")
  Start:  AIC=1356.03
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  - v1    1   1337.1 1355.1
  <none>      1336.0 1356.0
  - m     1   1339.0 1357.0
  - v2    1   1339.8 1357.8
  - co    1   1341.2 1359.2
  - b     1   1345.5 1363.5
  - c     4   1359.8 1371.8
  
  Step:  AIC=1355.07
  y ~ v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1337.1 1355.1
  - m     1   1340.0 1356.0
  - v2    1   1340.9 1356.9
  - co    1   1342.1 1358.1
  - b     1   1346.1 1362.1
  - c     4   1360.7 1370.7
  Start:  AIC=1244.31
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1224.3 1244.3
  - v1    1   1226.4 1244.4
  - m     1   1232.0 1250.0
  - v2    1   1236.2 1254.2
  - co    1   1236.4 1254.4
  - b     1   1258.4 1276.4
  - c     4   1312.2 1324.2
  Start:  AIC=1243.2
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1223.2 1243.2
  - v1    1   1226.7 1244.7
  - m     1   1230.2 1248.2
  - co    1   1234.2 1252.2
  - v2    1   1234.8 1252.8
  - b     1   1257.7 1275.7
  - c     4   1315.0 1327.0
  Start:  AIC=1242.59
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1222.6 1242.6
  - v1    1   1227.6 1245.6
  - m     1   1229.3 1247.3
  - co    1   1233.9 1251.9
  - v2    1   1233.9 1251.9
  - b     1   1256.1 1274.1
  - c     4   1316.3 1328.3
  Start:  AIC=1242.35
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1222.3 1242.3
  - v1    1   1227.9 1245.9
  - m     1   1230.0 1248.0
  - co    1   1233.1 1251.1
  - v2    1   1233.9 1251.9
  - b     1   1254.4 1272.4
  - c     4   1316.6 1328.6
  Start:  AIC=1356.03
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  - v1    1   1337.1 1355.1
  <none>      1336.0 1356.0
  - m     1   1339.0 1357.0
  - v2    1   1339.8 1357.8
  - co    1   1341.2 1359.2
  - b     1   1345.5 1363.5
  - c     4   1359.8 1371.8
  
  Step:  AIC=1355.07
  y ~ v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1337.1 1355.1
  - m     1   1340.0 1356.0
  - v2    1   1340.9 1356.9
  - co    1   1342.1 1358.1
  - b     1   1346.1 1362.1
  - c     4   1360.7 1370.7
  Start:  AIC=1244.31
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1224.3 1244.3
  - v1    1   1226.4 1244.4
  - m     1   1232.0 1250.0
  - v2    1   1236.2 1254.2
  - co    1   1236.4 1254.4
  - b     1   1258.4 1276.4
  - c     4   1312.2 1324.2
  Start:  AIC=1243.2
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1223.2 1243.2
  - v1    1   1226.7 1244.7
  - m     1   1230.2 1248.2
  - co    1   1234.2 1252.2
  - v2    1   1234.8 1252.8
  - b     1   1257.7 1275.7
  - c     4   1315.0 1327.0
  Start:  AIC=1242.59
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1222.6 1242.6
  - v1    1   1227.6 1245.6
  - m     1   1229.3 1247.3
  - co    1   1233.9 1251.9
  - v2    1   1233.9 1251.9
  - b     1   1256.1 1274.1
  - c     4   1316.3 1328.3
  Start:  AIC=1242.35
  y ~ v1 + v2 + m + b + c + co
  
         Df Deviance    AIC
  <none>      1222.3 1242.3
  - v1    1   1227.9 1245.9
  - m     1   1230.0 1248.0
  - co    1   1233.1 1251.1
  - v2    1   1233.9 1251.9
  - b     1   1254.4 1272.4
  - c     4   1316.6 1328.6
  
   Missings in variables:
   Variable Count
       NonD    14
      Dream    12
      Sleep     4
       Span     4
       Gest     4
  
   Imputed missings in variables:
   Variable Count
       NonD    14
      Dream    12
      Sleep     4
       Span     4
       Gest     4
  ── 1. Failure: kNN Tests for k==1 (@test_kNN.R#16)  ────────────────────────────
  ||... isn't false.
  kNN does not work as supposed.
  
  Time difference of 0.09311295 secs
  ── 2. Failure: kNN Tests for k==2 (@test_kNN.R#26)  ────────────────────────────
  !all(d2[7:12, 2] == (d2[1:6, 2] + d2[13:18, 2])/2) isn't false.
  kNN does not work as supposed.
  
  ── 3. Error: kNN Tests - randomForest (@test_kNN.R#74)  ────────────────────────
  Unsupported type of dependent variable.
  Backtrace:
   1. VIM::kNN(d, addRF = TRUE)
   2. VIM:::kNN.data.frame(d, addRF = TRUE)
   4. VIM:::kNN_work(...)
   5. ranger::ranger(ranger.formula, data = data.mod)
  
  ── 4. Error: kNN Tests - randomForest onlyRF (@test_kNN.R#81)  ─────────────────
  Unsupported type of dependent variable.
  Backtrace:
   1. VIM::kNN(d, addRF = TRUE, onlyRF = TRUE)
   2. VIM:::kNN.data.frame(d, addRF = TRUE, onlyRF = TRUE)
   4. VIM:::kNN_work(...)
   5. ranger::ranger(ranger.formula, data = data.mod)
  
  ── 5. Error: kNN Tests - randomForest dist_var vector (@test_kNN.R#90)  ────────
  Unsupported type of dependent variable.
  Backtrace:
   1. VIM::kNN(...)
   2. VIM:::kNN.data.frame(...)
   4. VIM:::kNN_work(...)
   5. ranger::ranger(ranger.formula, data = data.mod)
  
  ── 6. Error: kNN Tests - randomForest list (@test_kNN.R#100)  ──────────────────
  Unsupported type of dependent variable.
  Backtrace:
   1. VIM::kNN(...)
   2. VIM:::kNN.data.frame(...)
   4. VIM:::kNN_work(...)
   5. ranger::ranger(ranger.formula, data = data.mod)
  
  ── 7. Failure: kNN Tests - exact1 (@test_kNN_exact.R#16)  ──────────────────────
  dfImp$X2[8] == 3 isn't true.
  
  ── 8. Failure: kNN Tests - exact1 (@test_kNN_exact.R#22)  ──────────────────────
  dfImp2$X2[8] == 3 isn't true.
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 49 | SKIPPED: 24 | WARNINGS: 76 | FAILED: 8 ]
  1. Failure: kNN Tests for k==1 (@test_kNN.R#16) 
  2. Failure: kNN Tests for k==2 (@test_kNN.R#26) 
  3. Error: kNN Tests - randomForest (@test_kNN.R#74) 
  4. Error: kNN Tests - randomForest onlyRF (@test_kNN.R#81) 
  5. Error: kNN Tests - randomForest dist_var vector (@test_kNN.R#90) 
  6. Error: kNN Tests - randomForest list (@test_kNN.R#100) 
  7. Failure: kNN Tests - exact1 (@test_kNN_exact.R#16) 
  8. Failure: kNN Tests - exact1 (@test_kNN_exact.R#22) 
  
  Error: testthat unit tests failed
  Execution halted