title: Splitting data into disjoint sets
body: <p>I've a matrix (200x3) which i want to split into 3 random chosen <strong>disjoint</strong> sets. How can i realize it?</p>
  
  <p>I tried to do it via sample method but sample method accepts just vectors and output is not really part of my matrix. </p>
  
  <p>Thus, it is my matrix:</p>
  
  <pre><code>          X1           X2     Y
  1   -3.381342627  1.037658397 0
  2    3.329754336  1.964180648 0
  3    1.760001645 -3.414310545 0
  4   -2.450315854 -2.299838395 0
  5   -3.334593596  0.069458604 0
  6    1.708921101 -2.333932571 0
  7   -2.650506645  0.348985289 0
  8   -2.935307106 -0.402072990 0
  9    2.867566309 -3.217712074 0
  10   3.617603017  1.956535384 0
  </code></pre>
  
  <p>And i want to split in 3 sets like this: (row-numbers have to be random chosen). And i want to able to give the size of sets. For example in this case, 4 4 2.</p>
  
  <pre><code>9    2.867566309 -3.217712074 0
  3    1.760001645 -3.414310545 0
  1   -3.381342627  1.037658397 0
  2    3.329754336  1.964180648 0
  
  
  5   -3.334593596  0.069458604 0
  8   -2.935307106 -0.402072990 0
  4   -2.450315854 -2.299838395 0
  6    1.708921101 -2.333932571 0
  
  
  10   3.617603017  1.956535384 0
  7   -2.650506645  0.348985289 0
  </code></pre>