title: sample rows of subgroups from dataframe with dplyr
body: <p>If I want to randomly select some samples from different groups I use the plyr package and the code below</p>
  
  <pre><code>require(plyr)
  sampleGroup&lt;-function(df,size) {
    df[sample(nrow(df),size=size),]
  }
  
  iris.sample&lt;-ddply(iris,.(Species),function(df) sampleGroup(df,10))
  </code></pre>
  
  <p>Here 10 samples are selected from each  species.</p>
  
  <p>Some of my dataframes are very big and my question is can I use the same sampleGroup function with the dplyr package? Or is there another way to do the same in dplyr?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Version 0.2 of the dplyr package introduced two new functions to select random rows from a table sample_n and sample_frac</p>