Using caret to solve the examples from "Machine Learning with R"