The caret package includes a set of very useful functions for splitting the data prior to modeling. This is often necessary, as we typically need to work with both train and test datasets.
In this exercise, we will work with the famous mushroom dataset, which can be obtained from the UCI Machine Learning Repository.