title: Complex filtering R
body: <p>I have a dataset of three variables: number of sick days, age and gender.</p>
  
  <pre><code>       Sick days     Age  Gender
      1           5      39   F
      2           4      54   М
      3           5      42   М
      4           4      38   М
     ...
  </code></pre>
  
  <p>The aim is to plot a bar chart, in order to prove that the number of people older 35y miss more than 2 working days in a year more often than people under the age 35. </p>
  
  <p>I easily did this filtration using traditional methods:</p>
  
  <pre><code>&gt; data2&lt;- subset(data, Sick.days&gt;2) 
  &gt; sum(data2$Age &gt; 35)
    [1] 115
  &gt; sum(data2$Age &lt;= 35)
    [1] 36
  </code></pre>
  
  <p>But I wanted to use <strong>dplyr</strong> to get more elegant solution and I've been stuck. I don't understand how to calculate the number of filtered rows without using summarize.</p>
  
  <p>This is the example of how I did another filtration by Gender. I'd like to get something similar.</p>
  
  <pre><code>data%&gt;% filter(Sick.days &gt; 2) %&gt;% group_by(Gender) %&gt;% summarize(number=n()) %&gt;%
    ggplot(.,aes(x=Gender,y=number)) + 
    geom_bar(aes(group=Genser),stat="identity", width= 0.4, alpha=0.6,color="blue") + 
    labs(x="Gender",y="number of cases") + coord_flip()+theme_bw() 
  </code></pre>
  
  <p>Do you have any suggestions how to solve the problem using <strong>dplyr</strong>?</p>
  
  <p>Thank you.</p>