This Blog entry is from the Probability and Trees section in Learn R.
As with regression and most of the predictive analytics tools presented in this document, the predict() function can take the RegressionTree object in conjunction with a data frame, then return the predictions. To create predictions using the RegressionTree model and the FDX dataset:
RegressionTreePredictions <- predict(RegressionTree,FDX)
Run the line of script to console:
FDX <- mutate(FDX, RegressionTreePredictions)
Run the block of script to console: