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