order and fill with 2 different variables geom_bar ggplot2 R
问题 I have a question concerning the fill field in geom_bar of the ggplot2 package. I would like to fill my geom_bar with a variable (in the next example the variable is called var_fill ) but order the geom_plot with another variable (called clarity in the example). How can I do that? Thank you very much! The example: rm(list=ls()) set.seed(1) library(dplyr) data_ex <- diamonds %>% group_by(cut, clarity) %>% summarise(count = n()) %>% ungroup() %>% mutate(var_fill= LETTERS[sample.int(3, 40,