From f1d9fe8153aca9d1bbec30fc5671a1f28ba0debf Mon Sep 17 00:00:00 2001 From: El Potaeto Date: Wed, 21 Jan 2015 13:31:17 +0100 Subject: [PATCH] fix a bug introduced in previous commit --- R-package/R/xgb.importance.R | 3 +++ R-package/R/xgb.model.dt.tree.R | 2 +- R-package/R/xgb.plot.tree.R | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/R-package/R/xgb.importance.R b/R-package/R/xgb.importance.R index c1d772aff..094171382 100644 --- a/R-package/R/xgb.importance.R +++ b/R-package/R/xgb.importance.R @@ -82,4 +82,7 @@ linearDump <- function(feature_names, text){ which(text == "weight:") %>% {a=.+1;text[a:length(text)]} %>% as.numeric %>% data.table(Feature = feature_names, Weight = .) } +# Avoid error messages during CRAN check. +# The reason is that these variables are never declared +# They are mainly column names inferred by Data.table... globalVariables(".") \ No newline at end of file diff --git a/R-package/R/xgb.model.dt.tree.R b/R-package/R/xgb.model.dt.tree.R index 57d14933c..10e1e42d8 100644 --- a/R-package/R/xgb.model.dt.tree.R +++ b/R-package/R/xgb.model.dt.tree.R @@ -166,4 +166,4 @@ xgb.model.dt.tree <- function(feature_names = NULL, filename_dump = NULL, model # Avoid error messages during CRAN check. # The reason is that these variables are never declared # They are mainly column names inferred by Data.table... -globalVariables("ID", "Tree", "Yes", ".", "Feature", "Cover", "Quality", "No", "Gain", "Frequence") \ No newline at end of file +globalVariables(c("ID", "Tree", "Yes", ".", "Feature", "Cover", "Quality", "No", "Gain", "Frequence")) \ No newline at end of file diff --git a/R-package/R/xgb.plot.tree.R b/R-package/R/xgb.plot.tree.R index 3d1fc795c..662ccb21b 100644 --- a/R-package/R/xgb.plot.tree.R +++ b/R-package/R/xgb.plot.tree.R @@ -88,4 +88,7 @@ xgb.plot.tree <- function(feature_names = NULL, filename_dump = NULL, model = NU DiagrammeR(path, width, height) } -globalVariables("Feature", "yesPath", "ID", "Cover", "Quality", "Split", "Yes", "Yes.Feature", "noPath", "No", "No.Feature", ".") \ No newline at end of file +# Avoid error messages during CRAN check. +# The reason is that these variables are never declared +# They are mainly column names inferred by Data.table... +globalVariables(c("Feature", "yesPath", "ID", "Cover", "Quality", "Split", "Yes", "Yes.Feature", "noPath", "No", "No.Feature", ".")) \ No newline at end of file