geom_col(aes(fill=drv), position = position_dodge2(preserve = 'single')) + geom_errorbar(aes(ymin = count - 1, ymax = count + 1), position = position_dodge2(preserve = 'single', padding = 0.5)) 分组柱状图#每个柱子添加数据 mpg %>% group_by(class, drv) %>% summarise(count ...
{ x %>% mutate(country = reorder(country, score, decreasing = TRUE)) %>% fn() }, .keep = TRUE) } g_col <- data_scores %>% reorder_group(function(df) geom_col(data = df, position = position_dodge())) g_text <- data_scores %>% reorder_group(function(df) { geom_text( ...