I am learning the CARET Package in R and I am trying to run to code in Max Kuhn's paper "A Short Introduction to the caret Package". When I run the following code, after successfully installing CARET:
data(Sonar)set.seed(107)# The outcome data are needed, the percentage of data in the training set & the format of the results inTrain <- createDataPartition(y = Sonar$Class,p = .75, list = FALSE)str(inTrain)
I get the following error that this function createDataPartition() is not found:
Error in createDataPartition(y = Sonar$Class, p = 0.75, list = FALSE) : could not find function "createDataPartition"> str(inTrain)Error in str(inTrain) : object 'inTrain' not found
Any thoughts?
Best,
Mike