One example in the section titled &quot;Split into training and testing sets&quot; would be to use the createDataPartition() function from the caret package for creating training and testing sets.<p>He says &quot;In R, there are packages to make sampling simpler, but aren’t much more concise than using the built-in sample function&quot; but using caret is more concise.<p>Added: Later in the section on random forests he says &quot;With R, there are many smaller packages containing individual algorithms, often with inconsistent ways to access them.&quot; Which is why you want to use the caret package as it makes accessing many machine learning packages consistent and easy.