How to get the predicted y value for the training data from the results of xgboost function in R

how to get the predicted y value for the training data from the results of xgboost function in R? One can obtain the predicted y value for the testing data with function predict. Thank you.