Order the stacked barplot by proportion or percent in R
I can order my plot based on count but not by proportion. I want to bars on x-axis to be arranged by proportion of "c". Here is my code long<- data.frame( Name = c("abc","abc","abc","gif","gif","gif","xyz","xyz","xyz"), variable = c("a","b","c","a","b","c","c","b","a"), value = c(4,6,NA,2,8,1,6,NA,NA)) long_totals <- long %>% group_by(Name) %>% summarise(Total = sum(value, na.rm = T)) p<-long %>% mutate(variable… Read More Order the stacked barplot by proportion or percent in R