From 87b4332cc13d2a870254256e8ce54b5a628d1619 Mon Sep 17 00:00:00 2001 From: nagadomi Date: Thu, 9 Apr 2015 01:20:43 +0900 Subject: [PATCH] Fix length check in utils.R --- R-package/R/utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R-package/R/utils.R b/R-package/R/utils.R index 7336ed213..b0a86e2b6 100644 --- a/R-package/R/utils.R +++ b/R-package/R/utils.R @@ -36,8 +36,8 @@ xgb.setinfo <- function(dmat, name, info) { return(TRUE) } if (name == "group") { - if (length(info)!=xgb.numrow(dmat)) - stop("The length of groups must equal to the number of rows in the input data") + if (sum(info)!=xgb.numrow(dmat)) + stop("The sum of groups must equal to the number of rows in the input data") .Call("XGDMatrixSetInfo_R", dmat, name, as.integer(info), PACKAGE = "xgboost") return(TRUE)