title: How do i select a value from a column, based on a selection criteria on another column?
body: <p>How to select a value/name from a column, based on frequency(no. of repetitions) of a value in another column..in R?</p>
  
  <p>This is what my sample data is..:</p>
  
  <pre><code> Col1   col2  Col3  Col4 
   Yuva    123  qwe   XXYY
   Arun    234  asd   XYXY
   Yuva    870  ghj   XXYX
   Naan    890  qwe   XYYX
   Shan    231  asd   YXYX
   Yuva    453  qwe   YYXY
   Naan    314  ghj   YXYY
   Yuva    908  bnm   YYYx
  </code></pre>
  
  <p>Now i would like to know the function/statement which gives me pair of value from col1 and Col3 based on the number of times the value in col3 has occurred. i.e., what is the corresponding value in col1, when 'qwe' has occurred once(/twice/thrice).
  the expected(required) answer is:</p>
  
  <pre><code>                  Upon giving   I should get
                   --------------------------- 
                      qwe =1      Naan
                      qwe =2      Yuva 
                      qwe=3       ------(not available). similarly
                      asd=1       Arun
                                  Shan
                      ghj=1       Yuva
                                  Naan
                      ghj = 2      -----(not available)
             and for  bnm=1       Yuva.
  </code></pre>
  
  <p>Please help me guys.</p>