From a6c588f90d1e115518cac9492e35068d62ebea6d Mon Sep 17 00:00:00 2001 From: El Potaeto Date: Tue, 6 Jan 2015 13:59:14 +0100 Subject: [PATCH] fix arg check --- R-package/R/xgb.importance.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R-package/R/xgb.importance.R b/R-package/R/xgb.importance.R index 2071680d3..d5860e8a4 100644 --- a/R-package/R/xgb.importance.R +++ b/R-package/R/xgb.importance.R @@ -47,7 +47,7 @@ xgb.importance <- function(feature_names = NULL, filename_dump = NULL){ if (!class(feature_names) %in% c("character", "NULL")) { stop("feature_names: Has to be a vector of character or NULL if the model dump already contains feature name. Look at this function documentation to see where to get feature names.") } - if (class(filename_dump) != "character" & file.exists(filename_dump)) { + if (class(filename_dump) != "character" || !file.exists(filename_dump)) { stop("filename_dump: Has to be a path to the model dump file.") } text <- readLines(filename_dump)