title: Average of values in columns in dataframe?
body: <p>I want to find the mean across a dataframe of values. For example, if I have the following data:</p>
  
  <pre><code>ID Value Status
  1   10     A
  2   15     B
  3   20     A
  </code></pre>
  
  <p>And I want to find the mean of all values with the status A in it. How would I do so?</p>
  
  <p>Here is my attempt:</p>
  
  <pre><code>dataframe$balance.mean(dataframe$status == 'A')
  </code></pre>
  
  <p>But I keep getting an error that says <code>Error: attempt to apply non-function</code>. Can anyone help me out? Thanks!</p>