From 429f9561115e50c738d284aa0cee21e047e00084 Mon Sep 17 00:00:00 2001 From: david-cortes Date: Sat, 28 Sep 2024 23:52:15 +0200 Subject: [PATCH] [R] Fix warning from DT about mismatched names (#10743) --- R-package/R/xgb.plot.multi.trees.R | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/R-package/R/xgb.plot.multi.trees.R b/R-package/R/xgb.plot.multi.trees.R index f3f6bddffa8e..67a7a045172e 100644 --- a/R-package/R/xgb.plot.multi.trees.R +++ b/R-package/R/xgb.plot.multi.trees.R @@ -109,11 +109,10 @@ xgb.plot.multi.trees <- function(model, features_keep = 5, plot_width = NULL, pl edges.dt <- data.table::rbindlist( l = list( - tree.matrix[Feature != "Leaf", .(abs.node.position, Yes)], - tree.matrix[Feature != "Leaf", .(abs.node.position, No)] + tree.matrix[Feature != "Leaf", .(From = abs.node.position, To = Yes)], + tree.matrix[Feature != "Leaf", .(From = abs.node.position, To = No)] ) ) - data.table::setnames(edges.dt, c("From", "To")) edges.dt <- edges.dt[, .N, .(From, To)] edges.dt[, N := NULL]