In R, I am trying to turn the code below into a function (with a parameter variable instead of gender).
res_gender <- payments %>% group_by(yrmon,gende