title: How to remove rows in a dataframe based on values of another dataframe
body: <p>I am trying to filter out rows in my data frame (MainData), based on a criteria of p-values in another dataframe (PvalueData). So, what I want is: if more than 50% of the colums in a row has a p-value >0.05 (PvalueData), then that particular row will be removed from the main dataframe (MainDatA).</p>
  
  <p>Lets say, here is the data I have: </p>
  
  <p>MainData:</p>
  
  <pre><code>        C1   C2   C3   C4   C5
  Gene1   70   54   54   75   75
  Gene2   23   18   16   54   15
  Gene3   43   93   90   43   92
  Gene4   32   50   23   13   45
  Gene5   44   53   46   34   47
  Gene6   42   34   53   85   43
  Gene7   49   55   67   49   89
  Gene8   25   45   49   34   35
  Gene9   19   16   54   53   94
  </code></pre>
  
  <p>PvalueData:</p>
  
  <pre><code>        C1     C2     C3     C4     C5
  Gene1   0.04   0.01   0.01   0.01   0.01
  Gene2   0.01   0.01   0.01   0.02   0.01
  Gene3   0.01   0.07   0.09   0.01   0.06
  Gene4   0.01   0.03   0.06   0.01   0.02
  Gene5   0.04   0.01   0.07   0.08   0.01
  Gene6   0.09   0.07   0.01   0.06   0.06
  Gene7   0.10   0.07   0.01   0.01   0.06
  Gene8   0.01   0.01   0.02   0.01   0.01
  Gene9   0.09   0.01   0.07   0.08   0.06
  </code></pre>
  
  <p>So my result file should look like:</p>
  
  <p>Result: </p>
  
  <pre><code>        C1   C2   C3   C4   C5
  Gene1   70   54   54   75   75
  Gene2   23   18   16   54   15
  Gene4   32   50   23   13   45
  Gene5   44   53   46   34   47
  Gene8   25   45   49   34   35
  </code></pre>
  
  <p>I did try something like this: </p>
  
  <pre><code>check = if (PvalueData[!rowSums(PvalueData&gt;thres) &gt; ncol(PvalueData)*.5], MainData)
  </code></pre>
  
  <p>But can't really work it out.</p>