Running examples in ‘xgboost-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: xgb.ggplot.deepness
> ### Title: Plot model trees deepness
> ### Aliases: xgb.ggplot.deepness xgb.plot.deepness
> 
> ### ** Examples
> 
> 
> data(agaricus.train, package='xgboost')
> ## Keep the number of threads to 2 for examples
> nthread <- 2
> data.table::setDTthreads(nthread)
> 
> ## Change max_depth to a higher number to get a more significant result
> bst <- xgboost(data = agaricus.train$data, label = agaricus.train$label, max_depth = 6,
+                eta = 0.1, nthread = nthread, nrounds = 50, objective = "binary:logistic",
+                subsample = 0.5, min_child_weight = 2)
[1]	train-logloss:0.600003 
[2]	train-logloss:0.524033 
[3]	train-logloss:0.459649 
[4]	train-logloss:0.405417 
[5]	train-logloss:0.359278 
[6]	train-logloss:0.319218 
[7]	train-logloss:0.284446 
[8]	train-logloss:0.254133 
[9]	train-logloss:0.227677 
[10]	train-logloss:0.204192 
[11]	train-logloss:0.183195 
[12]	train-logloss:0.164763 
[13]	train-logloss:0.148895 
[14]	train-logloss:0.134068 
[15]	train-logloss:0.121147 
[16]	train-logloss:0.109301 
[17]	train-logloss:0.099045 
[18]	train-logloss:0.089818 
[19]	train-logloss:0.081742 
[20]	train-logloss:0.074330 
[21]	train-logloss:0.067892 
[22]	train-logloss:0.061658 
[23]	train-logloss:0.056055 
[24]	train-logloss:0.050891 
[25]	train-logloss:0.046377 
[26]	train-logloss:0.042650 
[27]	train-logloss:0.038807 
[28]	train-logloss:0.035790 
[29]	train-logloss:0.032877 
[30]	train-logloss:0.030181 
[31]	train-logloss:0.027812 
[32]	train-logloss:0.025544 
[33]	train-logloss:0.023470 
[34]	train-logloss:0.021666 
[35]	train-logloss:0.019980 
[36]	train-logloss:0.018528 
[37]	train-logloss:0.017192 
[38]	train-logloss:0.015929 
[39]	train-logloss:0.014977 
[40]	train-logloss:0.013998 
[41]	train-logloss:0.013148 
[42]	train-logloss:0.012292 
[43]	train-logloss:0.011556 
[44]	train-logloss:0.010909 
[45]	train-logloss:0.010316 
[46]	train-logloss:0.009684 
[47]	train-logloss:0.009265 
[48]	train-logloss:0.008787 
[49]	train-logloss:0.008370 
[50]	train-logloss:0.007953 
> 
> xgb.plot.deepness(bst)
Error: igraph package is required for plotting the graph deepness.
Execution halted