Thank you for utterly informative series of R videos. Cab you please provide me with a code how to add a percentage in stucked bar? Instead of only absolute numbers. Like N(n%)
thanks Aram for your kind words. You can use below layer in ggplot function to add percentage in stacked bar chart. However, please ensure you have converted your absolute values into percentages and then call this percent values in the ggplot layer. scale_y_continuous(labels = scales::percent) + geom_text(aes(label = paste0(value*100,"%")), position = position_stack(vjust = 0.5), size = 2) Please have a look at this post from Stack overflow for more information: stackoverflow.com/questions/44724580/add-percentage-labels-to-a-stacked-barplot