title: Calculate mean of column data based on conditions in another column
body: <p>I have a dataframe with a transnational data structure that looks something similar to the below:</p>
  
  <pre><code>ID   RANK   GRADE
  123  E1     0
  123  E1     42
  123  E1     NA
  123  E2     41
  123  E2     42
  456  E2     41
  456  E2     41
  456  E3     NA
  </code></pre>
  
  <p>I want to calculate the mean of the Grade column for each Rank based on the ID, ignoring the values that are 0 because they are data entry errors, and ignoring the NA's.  </p>
  
  <p>For example:  For ID 123, I want the mean of Grade when their rank was E1, then for E2, etc.   </p>