I've been traying to perform a simple task.
I have this:
datasets::esoph esoph %>% group_by(agegp,ncases) %>% summarise(n=n()) %>% adorn_totals("row") %>% filter(agegp=="75+" | agegp=="Total")
Now, using dplyr and mutate, I would like to get the ratio of row 1 over row 2:
That code doesn't work. I intend to reproduce this as you can imagine:
`summarise()` regrouping output by 'agegp' (override with `.groups` argument) agegp ncases n 75+ 2 3 Total 106 88 ratio 1.88 3.41
Thanks for your time and interest.