title: Stratified random sampling from data frame
body: <p>I have a data frame in the format:</p>
  
  <pre><code>head(subset)
  # ants  0 1 1 0 1 
  # age   1 2 2 1 3
  # lc    1 1 0 1 0
  </code></pre>
  
  <p>I need to create new data frame with random samples according to age and lc. For example I want 30 samples from age:1 and lc:1, 30 samples from age:1 and lc:0 etc. </p>
  
  <p>I did look at random sampling method like; </p>
  
  <pre><code>newdata &lt;- function(subset, age, 30)
  </code></pre>
  
  <p>But it is not the code that I want. </p>