
This is my data. For each year I want to get the proportion of each of marital_status. For instance, in the year 2000 proportion of married people is 57291/(57291+58238+18181). Like this, for each year and for each marital_case I want a proportion. But in R, when I am doing proportion, all the counts of marital_status are added and it gives a proportion of the whole data frame. I have tried group_by but doesn't work.