title: Sample rows based on weights or probability from a data.frame
body: <p>I would like to sample from 3 groups of data (rows) in a dataframe according to different probabilities.
  So for instance the data looks like</p>
  
  <pre><code>group&lt;-c(1,1,1,2,2,3,3)
  var1&lt;-c('aa','ab','ac','ba','bb','ca','ce')
  var2&lt;-c('aaa','aba','aca','baa','bba','caa','cba')
  var3&lt;-c('aab','abb','acb','bab','bbb','cab','ceb')
  data&lt;-data.frame(group,var1,var2,var3)
  </code></pre>
  
  <p>Now I would like to sample (e.g. totoal of 5) from the whole dataframe (get rows) based on different probabilities (for group==1 --> 0.5, group==2 -->0.4, group==3 -->0.1)</p>
  
  <p>Does anyone know how to solve that with R? Help would be much appreciated.
  Cheers</p>
  
  <p>...</p>