I have created a frequency table, DF, using the code below. However I would also like to create a column of percentages/proportions within the table, to see the percentage/proportion of each Function for each key. I am not sure how to adapt my code to do this. Any advice and help would be appreciated!
gather(key = 'key', value = 'freq', -Function) %>%
mutate(freq = as.numeric(freq)) %>%
group_by(Function, key) %>%
summarise(freq=sum(freq)) ```