[R] [CI] enforce lintr::function_left_parentheses_linter check (#9631)

This commit is contained in:
James Lamb
2023-10-07 20:42:09 -05:00
committed by GitHub
parent 4d7a187cb0
commit 799f8485e2
14 changed files with 33 additions and 32 deletions

View File

@@ -21,13 +21,13 @@ xgb.Booster.handle <- function(params, cachelist, modelfile, handle) {
## A memory buffer
bst <- xgb.unserialize(modelfile, handle)
xgb.parameters(bst) <- params
return (bst)
return(bst)
} else if (inherits(modelfile, "xgb.Booster")) {
## A booster object
bst <- xgb.Booster.complete(modelfile, saveraw = TRUE)
bst <- xgb.unserialize(bst$raw)
xgb.parameters(bst) <- params
return (bst)
return(bst)
} else {
stop("modelfile must be either character filename, or raw booster dump, or xgb.Booster object")
}
@@ -382,7 +382,7 @@ predict.xgb.Booster <- function(object, newdata, missing = NA, outputmargin = FA
cval[0] <- val
return(cval)
}
return (val)
return(val)
}
## We set strict_shape to TRUE then drop the dimensions conditionally

View File

@@ -117,7 +117,7 @@ xgb.get.DMatrix <- function(data, label, missing, weight, nthread) {
stop("xgboost: invalid input data")
}
}
return (dtrain)
return(dtrain)
}

View File

@@ -18,6 +18,6 @@ xgb.load.raw <- function(buffer, as_booster = FALSE) {
booster <- xgb.Booster.complete(booster, saveraw = TRUE)
return(booster)
} else {
return (handle)
return(handle)
}
}

View File

@@ -37,5 +37,5 @@ xgb.unserialize <- function(buffer, handle = NULL) {
}
})
class(handle) <- "xgb.Booster.handle"
return (handle)
return(handle)
}

View File

@@ -24,7 +24,7 @@ xgboost <- function(data = NULL, label = NULL, missing = NA, weight = NULL,
early_stopping_rounds = early_stopping_rounds, maximize = maximize,
save_period = save_period, save_name = save_name,
xgb_model = xgb_model, callbacks = callbacks, ...)
return (bst)
return(bst)
}
#' Training part from Mushroom Data Set