title: R: Select each 10 random entries from a column based on values in other column
body: <p>Apologies if this has been asked before - i did use the Search function.</p>
  
  <p>Variable X has 1-100 categories with a variable number of rows per category (all above 10). Variable Y has values associated with each X. How can I extract a random subsample of Y with each 10 Y per X? The goal is to reduce the total amount of data in the file (right now it has 11000 rows, ideally with the output of a binary coded column Z to include/exclude cases (where Z is assigned to random 10 Y's of each category X.</p>
  
  <p>It should be fairly easy I guess?</p>
  
  <p>Regards, 
  KCW</p>