when you perform k-fold cross validation, you already make a prediction for each sample, more than 10 different models in total (assuming k = 10). There is no need to make a forecast for complete data, since you already have your forecasts from k different models.
What you can do is the following:
train_control<- trainControl(method="cv", number=10, savePredictions = TRUE)
Then
model<- train(resp~., data=mydat, trControl=train_control, method="rpart")
if you want to see observables and predictions in a good format, you simply type:
model$pred
Also for the second part of your question, the carriage should handle all the parameters. You can manually try to adjust the settings if you want.
source share