title: R, Caret: how do I specify train and holdout (validation) sets?
body: <p>I have a data set and would like caret to train and validate on a specific part of my data set only. I have two lists</p>
  
  <pre><code>train.ids &lt;- list(T1=c(1,2,3), T2=c(4,5,6), T3=c(7,8,9))
  </code></pre>
  
  <p>and</p>
  
  <pre><code>test.ids &lt;- list(T1=c(10,11,12), T2=c(13,14,15), T3=(16,17,18))
  </code></pre>
  
  <p>which correspond to the row indices in my data set. <code>train.ids$T1</code> should be used for training, while <code>test.ids$T1</code> should be used for testing. Same goes for T2 and T3.</p>
  
  <p>I tried using</p>
  
  <pre><code>trainControl(method="cv", index=train.ids, indexOut=test.ids)
  </code></pre>
  
  <p>but this doesn't seem to be the correct way of using trainControl.</p>
  
  <p>Any help is highly appreciated</p>