title: CARET. Relationship between data splitting and trainControl
body: <p>I have carefully read the <a href="http://cran.r-project.org/web/packages/caret/index.html" rel="noreferrer">CARET</a> documentation at: <a href="http://caret.r-forge.r-project.org/training.html" rel="noreferrer">http://caret.r-forge.r-project.org/training.html</a>, the vignettes, and everything is quite clear (the examples on the website help a lot!), but I am still a confused about the relationship between two arguments to <code>trainControl</code>:</p>
  
  <pre><code>method 
  index
  </code></pre>
  
  <p>and the interplay between <code>trainControl</code> and the data splitting functions in caret (e.g. <code>createDataPartition</code>, <code>createResample</code>, <code>createFolds</code> and <code>createMultiFolds</code>)</p>
  
  <p>To better frame my questions, let me use the following example from  the documentation:</p>
  
  <pre><code>data(BloodBrain)
  set.seed(1)
  tmp &lt;- createDataPartition(logBBB,p = .8, times = 100)
  trControl = trainControl(method = "LGOCV", index = tmp)
  ctreeFit &lt;- train(bbbDescr, logBBB, "ctree",trControl=trControl)
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li><p>If I use <code>createDataPartition</code> (which I assume that does stratified bootstrapping), as in the above example, and I pass the result as <code>index</code> to <code>trainControl</code> do I need to use <code>LGOCV</code> as the method in my call <code>trainControl</code>? If I use another one (e.g. <code>cv</code>) What difference would it make? In my head, once you fix <code>index</code>, you are essentially choosing  the type of cross-validation, so I am not sure what role <code>method</code> plays if you use <code>index</code>.</p></li>
  <li><p>What is the difference between <code>createDataPartition</code> and <code>createResample</code>? Is it that <code>createDataPartition</code> does stratified bootstrapping, while <code>createResample</code> doesn't?</p></li>
  </ol>
  
  <p>3) How can I do <strong>stratified</strong> k-fold (e.g. 10 fold) cross validation using caret? Would the following do it?</p>
  
  <pre><code>tmp &lt;- createFolds(logBBB, k=10, list=TRUE,  times = 100)
  trControl = trainControl(method = "cv", index = tmp)
  ctreeFit &lt;- train(bbbDescr, logBBB, "ctree",trControl=trControl)
  </code></pre>