title: R-How to count the number of non-zero value in a column by year?
body: <p>My table has four columns, 'year', 'doy', 'rain', and 'crain'. The column 'year' ranges from 1957-2007 and the column 'doy' ranges from 1-365(or366). </p>
  
  <p>What I'm trying to know is:</p>
  
  <p>For each year (1957-2007), how many rows has non-zero value in the column 'rain'? </p>
  
  <p>For example, in 1957, I would like to know how many rows has non-zero value in the column 'rain'?</p>
  
  <p>Any help will be greatly appreciated! Thank you. </p>
  
  <p>Gloria</p>