【发布时间】:2022-02-09 07:52:21
【问题描述】:
我正在尝试添加重新排序以使数据集从最大到最小排列但有问题。
ggplot(Manager_Graph_Data, aes(x = reorder(Manager_Graph_Data$`Completion Rate`), y = Manager_Graph_Data$Manager)) +
geom_bar(stat="identity",
position="identity",
fill="#0077b5")
structure(list(Manager = c("Bob Beno", "Dylan Tracy", "Ignacia Lemley",
"Jaimee Cogdill", "Jeneva Engman", "Julianne Holdren", "Lakia Farrington",
"Lester Braden", "Soon Mooneyham"), Complete = c(5, 5, 1, 4,
0, 0, 3, 2, 5), Incomplete = c(6, 6, 7, 2, 3, 4, 5, 2, 3), Total = c(11,
11, 8, 6, 3, 4, 8, 4, 8), `Completion Rate` = c(0.454545454545455,
0.454545454545455, 0.125, 0.666666666666667, 0, 0, 0.375, 0.5,
0.625)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-9L))
任何帮助将不胜感激
【问题讨论】:
-
Don't use
$insideaes。您还调用了reorder,它不会对分类列(经理)做任何事情——您只是在要排序的列上调用它