I am struggling with a problem in R. I want to count all the ages for a specific gender and then write their absolute and relative frequenceis.
Consider my data is:
AGE Place Gender
12 SA M
33 MA F
14 KA N
36 MA N
32 DA N
36 HA F
In the data above, I would like to sum all occurrences of AGE for M, F and N, so the result will be something like:
AGE Gender
12 M
69 F
82 N
How can I do this in R?
Thank You.