diff --git a/R-package/NAMESPACE b/R-package/NAMESPACE index 3a590f27a..a9ae672a3 100644 --- a/R-package/NAMESPACE +++ b/R-package/NAMESPACE @@ -37,6 +37,7 @@ importFrom(data.table,setnames) importFrom(magrittr,"%>%") importFrom(magrittr,add) importFrom(magrittr,not) +importFrom(stringr,str_detect) importFrom(stringr,str_extract) importFrom(stringr,str_extract_all) importFrom(stringr,str_match) diff --git a/R-package/R/xgb.model.dt.tree.R b/R-package/R/xgb.model.dt.tree.R index 5833389e2..13d3ecc5b 100644 --- a/R-package/R/xgb.model.dt.tree.R +++ b/R-package/R/xgb.model.dt.tree.R @@ -12,7 +12,6 @@ #' @importFrom magrittr add #' @importFrom stringr str_extract #' @importFrom stringr str_split -#' @importFrom stringr str_extract #' @importFrom stringr str_trim #' @param feature_names names of each feature as a character vector. Can be extracted from a sparse matrix (see example). If model dump already contains feature names, this argument should be \code{NULL}. #' @param filename_dump the path to the text file storing the model. Model dump must include the gain per feature and per tree (parameter \code{with.stats = T} in function \code{xgb.dump}). diff --git a/R-package/R/xgb.plot.multi.trees.R b/R-package/R/xgb.plot.multi.trees.R index d30d86332..f53d1a13f 100644 --- a/R-package/R/xgb.plot.multi.trees.R +++ b/R-package/R/xgb.plot.multi.trees.R @@ -7,6 +7,8 @@ #' @importFrom data.table setnames #' @importFrom data.table := #' @importFrom magrittr %>% +#' @importFrom stringr str_detect +#' @importFrom stringr str_extract #' #' @param filename_dump the path to the text file storing the model. Model dump must include the gain per feature and per tree (parameter \code{with.stats = T} in function \code{xgb.dump}). #' @param model dump generated by the \code{xgb.train} function. Avoid the creation of a dump file. @@ -83,9 +85,8 @@ xgb.plot.multi.trees <- function(model, names, features.keep = 5, plot.width = N label = nodes.dt[,Text], style = "filled", color = "DimGray", - fillcolor= "Blue", - shape = "oval", - #data = allTrees[,Feature] + fillcolor= "Beige", + shape = "oval", fontname = "Helvetica" )