Running ‘testthat.R’ [20s/18s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(xgboost)
  > 
  > test_check("xgboost")
  [1]	train-error:0.016275 
  [1]	train-auc:0.900000	test-auc:0.800000 
  [1]	eval-error:0.042831	train-error:0.046522 
  [2]	eval-error:0.021726	train-error:0.022263 
  [1]	eval-error:0.042831	train-error:0.046522 
  [2]	eval-error:0.021726	train-error:0.022263 
  [1]	train-error:0.046522 
  [2]	train-error:0.022263 
  [1]	train-error:0.333333 
  ── 1. Error: xgb.importance works with and without feature names (@test_helpers.
  ggplot2 package is required
  1: xgb.ggplot.importance(importance_matrix = importance.Tree) at testthat/test_helpers.R:255
  2: stop("ggplot2 package is required", call. = FALSE)
  
  ── 2. Error: xgb.importance works with GLM model (@test_helpers.R#270)  ────────
  ggplot2 package is required
  1: xgb.ggplot.importance(importance.GLM) at testthat/test_helpers.R:270
  2: stop("ggplot2 package is required", call. = FALSE)
  
  ── 3. Error: xgb.plot.tree works with and without feature names (@test_helpers.R
  DiagrammeR package is required for xgb.plot.tree
  1: xgb.plot.tree(feature_names = feature.names, model = bst.Tree) at testthat/test_helpers.R:290
  2: stop("DiagrammeR package is required for xgb.plot.tree", call. = FALSE)
  
  ── 4. Error: xgb.plot.multi.trees works with and without feature names (@test_he
  there is no package called 'DiagrammeR'
  1: xgb.plot.multi.trees(model = bst.Tree, feature_names = feature.names, features_keep = 3) at testthat/test_helpers.R:295
  2: DiagrammeR::create_node_df
  3: getExportedValue(pkg, name)
  4: asNamespace(ns)
  5: getNamespace(ns)
  6: loadNamespace(name)
  7: withRestarts(stop(cond), retry_loadNamespace = function() NULL)
  8: withOneRestart(expr, restarts[[1L]])
  9: doWithOneRestart(return(expr), restart)
  
  ── 5. Error: xgb.plot.deepness works (@test_helpers.R#303)  ────────────────────
  ggplot2 package is required for plotting the graph deepness.
  1: xgb.ggplot.deepness(model = bst.Tree) at testthat/test_helpers.R:303
  2: stop("ggplot2 package is required for plotting the graph deepness.", call. = FALSE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 539 SKIPPED: 2 FAILED: 5
  1. Error: xgb.importance works with and without feature names (@test_helpers.R#255) 
  2. Error: xgb.importance works with GLM model (@test_helpers.R#270) 
  3. Error: xgb.plot.tree works with and without feature names (@test_helpers.R#290) 
  4. Error: xgb.plot.multi.trees works with and without feature names (@test_helpers.R#295) 
  5. Error: xgb.plot.deepness works (@test_helpers.R#303) 
  
  Error: testthat unit tests failed
  Execution halted