title: Count values higher than a certain threshold by group
body: <p>I have quite a huge historical meteo station csv dataset (<strong>daily</strong> wind speed data from a set of weather stations for a region) and I would need to compute the average number of days per month in which wind speed is higher than 6 m/s for each meteo station. The stations does not contain data for the same number of years. An example of the dataset is shown below. </p>
  
  <pre><code>head(windspeed_PR)
  
    STN    Year Month Day WDSP WDSP.ms
  1 860110 1974     6  19  9.3   4.784
  2 860110 1974     7  13 19.0   9.774
  3 860110 1974     7  22  9.9   5.093
  4 860110 1974     8  20  9.5   4.887
  5 860110 1974     9  10  3.3   1.698
  6 860110 1974    10  10  6.6   3.395
  </code></pre>
  
  <p>Therefore, I basically would need to count how many <strong>WDPS.ms</strong> values are higher than 6 for each <strong>Month</strong> of the <strong>Year</strong> and each station (<strong>STN</strong>), and then calculate the average number of days per month per meteo station </p>
  
  <p>Could I please have suggestions on how to compute this value (preferibly in R)?</p>