Skip to content

Commit b851c1c

Browse files
committed
check for installation
1 parent 8cef8ba commit b851c1c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

R/boost_tree.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ xgb_train <- function(
271271
event_level = c("first", "second"),
272272
...
273273
) {
274+
rlang::check_installed("xgboost")
274275
event_level <- rlang::arg_match(event_level, c("first", "second"))
275276
others <- list(...)
276277

@@ -510,6 +511,7 @@ as_xgb_data <- function(
510511
event_level = "first",
511512
...
512513
) {
514+
rlang::check_installed("xgboost")
513515
lvls <- levels(y)
514516
n <- nrow(x)
515517

@@ -649,6 +651,7 @@ multi_predict._xgb.Booster <-
649651
}
650652

651653
xgb_by_tree <- function(tree, object, new_data, type, ...) {
654+
rlang::check_installed("xgboost")
652655
if (utils::packageVersion("xgboost") >= "2.0.0.0") {
653656
pred <- xgb_predict(
654657
object$fit,

0 commit comments

Comments
 (0)