title: filtering with multiple conditions on many columns using dplyr
body: <p>I've searched on SO trying to find a solution to no avail. So here it is. I have a data frame with many columns, some of which are numerical and should be non-negative. I want to clean the data since some values in these numerical columns are negative. What I can do now is extract the column names of these columns with a regular expression. But I am not sure how to implement the filtering of rows based on these columns. </p>
  
  <p>To give an example, let's say:</p>
  
  <pre><code>library(dplyr)
  df &lt;- read.table(text = 
    "id   sth1    tg1_num   sth2    tg2_num    others   
    1     dave    2         ca      35         new
    2     tom     5         tn      -3         old
    3     jane    -3        al       0         new
    4     leroy   0         az      25         old
    5     jerry   4         mi      55        old", header=TRUE)
  pattern &lt;- "_num$"
  ind &lt;- grep(pattern, colnames(df))
  target_columns &lt;- colnames(df)[ind]
  df &lt;- df %&gt;% filter(target_columns &gt;= 0) # it's is wrong, but it's what I want to do
  </code></pre>
  
  <p>What I want to get out from this filtering is the following:</p>
  
  <pre><code>id   sth1 tg1_num   sth2 tg2_num others
  1    dave       2     ca      35    new
  4   leroy       0     az      25    old
  5   jerry       4     mi      55    old
  </code></pre>
  
  <p>where rows no. 2 and 3 are filtered out because at least one column in tg1_num and tg2_num for these rows contain negative numbers.</p>