title: How to get the class probabilities AND predictions from caret::predict()?
body: <p>In addition to predicting the class labels, is it possible to return the expectation of each observation in new data when predicting?</p>
  
  <pre><code>library(caret)
  knnFit &lt;- train(Species ~ ., data = iris, method = "knn", 
                  trControl = trainControl(method = "cv", classProbs = TRUE))
  
  x &lt;- predict(knnFit, newdata = iris)
  </code></pre>
  
  <p>Returns a vector of the predicted classes.</p>
  
  <pre><code>str(x)
  Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
  </code></pre>
  
  <p>If I want the probabilities:</p>
  
  <pre><code>x &lt;- predict(knnFit, newdata = iris, type = "prob")
  &gt; head(x)
    setosa versicolor virginica
  1      1          0         0
  2      1          0         0
  3      1          0         0
  4      1          0         0
  5      1          0         0
  6      1          0         0
  </code></pre>
  
  <p>Is it possible to have caret return both the predictions and the probabilities? I know I can calculate by taking max.col of probabilities version but I wondered if there's a built in way to get both?</p>