Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11811

CARET Package in R - createDataPartition() function not found?

$
0
0

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


Viewing all articles
Browse latest Browse all 11811

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>