R langauge how to create xgb.DMatrix object from data frame (newbe)
Welcome to the site!

Assume that y is your response, and x is your data set of predictors (where categorical variables have been appropriately converted to numeric). Your data does not necessarily need to be sparse, although sparse data will improve computation speed.

Then dtrain &lt;- xgb.DMatrix(label = y, data = as.matrix(x)).

As you get more proficient with XGBoost you can start exploring the weight and base_margin parameters.