I have two columns in a dataset that represent meetings
| Occupation | Gender |
|---|---|
| Director | M |
| Director | F |
| VP | M |
| Director | F |
| Secretary | F |
| Director | F |
So here we have 6 meetings, and these are the two proportions i'd like to obtain :
1 - Prop. of female director meetings / all the meetings (3/6) 2 - Prop. of female director meetings / meetings attended by women (3/4)
Of course i have thousands of observations.
I tried with the solution given here How to calculate proportions from multiple variables but i don't obtain the results that i want.
I'm pretty sure that is easy but i don't know how to take into account the "if" conditions. Also, i'd like to present the results through chart so it's better if the output is a data frame.