R-Caret, caretList, The metric "Accuracy" was not in the result set
<p>Trying to learn r-Caret and caretList.
I am trying to follow the tutorial <a href="http://www.r-bloggers.com/caretensemble-classification-example/" rel="nofollow">caretEnsemble Classification example</a></p>

<p>I have encountered a few errors and searched how to fix some of the basic set up.
However, I am getting the error:</p>

<pre><code>Warning messages:
1: In train.default(x, y, weights = w, ...) :
The metric "Accuracy" was not in the result set. ROC will be used instead.
2: In train.default(x, y, weights = w, ...) :
The metric "Accuracy" was not in the result set. ROC will be used instead.
</code></pre>

<p>My setup is:</p>

<pre><code>#Libraries
library(caret)
library(devtools)
library(caretEnsemble)

#Data
library(mlbench)
dat &lt;- mlbench.xor(500, 2)
X &lt;- data.frame(dat$x)
Y &lt;- factor(ifelse(dat$classes=='1', 'Yes', 'No'))

#Split train/test
train &lt;- runif(nrow(X)) &lt;= .66

#Setup CV Folds
#returnData=FALSE saves some space
folds=5
repeats=1
myControl &lt;- trainControl(method='cv', 
                      number=folds, 
                      repeats=repeats, 
                      returnResamp='none', 
                      classProbs=TRUE,
                      returnData=FALSE, 
                      savePredictions=TRUE, 
                      verboseIter=TRUE, 
                      allowParallel=TRUE,
                      summaryFunction=twoClassSummary,
                      index=createMultiFolds(Y[train], 
                                             k=folds, 
                                             times=repeats)
)
#Make list of all models
all.models&lt;-caretList(Y~., data=X, trControl=myControl, methodList=c("blackboost", "parRF"))
</code></pre>

<p>I edited the section of "train all models" using caretList so that it will work with caretEnsemble and caretStack further down the code (link provided above).</p>

<p>How do I get the accuracies so that I can use them in caretEnsemble and caretStack?</p>