error early if missing DiagrammeR (#8037)
This commit is contained in:
parent
bc4f802b17
commit
3af02584c1
@ -62,6 +62,9 @@
|
|||||||
#' @export
|
#' @export
|
||||||
xgb.plot.multi.trees <- function(model, feature_names = NULL, features_keep = 5, plot_width = NULL, plot_height = NULL,
|
xgb.plot.multi.trees <- function(model, feature_names = NULL, features_keep = 5, plot_width = NULL, plot_height = NULL,
|
||||||
render = TRUE, ...){
|
render = TRUE, ...){
|
||||||
|
if (!requireNamespace("DiagrammeR", quietly = TRUE)) {
|
||||||
|
stop("DiagrammeR is required for xgb.plot.multi.trees")
|
||||||
|
}
|
||||||
check.deprecation(...)
|
check.deprecation(...)
|
||||||
tree.matrix <- xgb.model.dt.tree(feature_names = feature_names, model = model)
|
tree.matrix <- xgb.model.dt.tree(feature_names = feature_names, model = model)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user