diff --git a/R-package/R/xgb.DMatrix.R b/R-package/R/xgb.DMatrix.R index 20aab5335..fc2609416 100644 --- a/R-package/R/xgb.DMatrix.R +++ b/R-package/R/xgb.DMatrix.R @@ -88,7 +88,7 @@ xgb.DMatrix <- function(data, info = list(), missing = NA, silent = FALSE, nthre # get dmatrix from data, label # internal helper method -xgb.get.DMatrix <- function(data, label = NULL, missing = NA, weight = NULL, nthread = NULL) { +xgb.get.DMatrix <- function(data, label, missing, weight, nthread) { if (inherits(data, "dgCMatrix") || is.matrix(data)) { if (is.null(label)) { stop("label must be provided when data is a matrix") diff --git a/R-package/R/xgb.cv.R b/R-package/R/xgb.cv.R index 24c1b3f3c..0b1baaa84 100644 --- a/R-package/R/xgb.cv.R +++ b/R-package/R/xgb.cv.R @@ -194,7 +194,13 @@ xgb.cv <- function(params = list(), data, nrounds, nfold, label = NULL, missing # create the booster-folds # train_folds - dall <- xgb.get.DMatrix(data, label, missing, nthread = params$nthread) + dall <- xgb.get.DMatrix( + data = data, + label = label, + missing = missing, + weight = NULL, + nthread = params$nthread + ) bst_folds <- lapply(seq_along(folds), function(k) { dtest <- slice(dall, folds[[k]]) # code originally contributed by @RolandASc on stackoverflow diff --git a/R-package/R/xgb.ggplot.R b/R-package/R/xgb.ggplot.R index 69d26e2c4..e79644543 100644 --- a/R-package/R/xgb.ggplot.R +++ b/R-package/R/xgb.ggplot.R @@ -183,7 +183,7 @@ normalize <- function(x) { # ... the plots # cols number of columns # internal utility function -multiplot <- function(..., cols = 1) { +multiplot <- function(..., cols) { plots <- list(...) num_plots <- length(plots) diff --git a/R-package/R/xgboost.R b/R-package/R/xgboost.R index a1a8f9573..db4fd67aa 100644 --- a/R-package/R/xgboost.R +++ b/R-package/R/xgboost.R @@ -10,7 +10,13 @@ xgboost <- function(data = NULL, label = NULL, missing = NA, weight = NULL, save_period = NULL, save_name = "xgboost.model", xgb_model = NULL, callbacks = list(), ...) { merged <- check.booster.params(params, ...) - dtrain <- xgb.get.DMatrix(data, label, missing, weight, nthread = merged$nthread) + dtrain <- xgb.get.DMatrix( + data = data, + label = label, + missing = missing, + weight = weight, + nthread = merged$nthread + ) watchlist <- list(train = dtrain)