Could not find function > "xgb.DMatrix" in R

r
xgboost

#1

0
down vote
favorite
str(new_my_data)
‘data.frame’: 1082426 obs. of 91 variables:

** My all variables are belong to Numerical and integer.

forming Data set

train_index <- sample(1:nrow(new_my_data), nrow(new_my_data)*0.75)
data_variables <- as.matrix(new_my_data[,-1])
data_label <- new_my_data[,“has_booking”]
data_matrix <- xgb.DMatrix(data = as.matrix(new_my_data), label = data_label)

str(new_my_data)
‘data.frame’: 1082426 obs. of 91 variables:

** My all variables are belong to Numerical and integer.

install.packages(“xgboost”)
library(xgboost)

forming Data set

train_index <- sample(1:nrow(new_my_data), nrow(new_my_data)*0.75)
data_variables <- as.matrix(new_my_data[,-1])
data_label <- new_my_data[,“has_booking”]
data_matrix <- xgb.DMatrix(data = as.matrix(new_my_data), label = data_label)
Getting below error message.

Error in eval(expr, envir, enclos): could not find function
"xgb.DMatrix" Traceback:
I am building my model for XGboost (logistic classification).