ggplot方面图重新排序无法按预期工作

时间:2018-11-05 16:52:02

标签: r ggplot2

这是我的数据集:https://www.dropbox.com/s/31qvc6miew2qkpp/top_terms.csv?dl=0

top_terms = read.csv("top_terms.csv")
top_terms %>% # take the top terms
          mutate(term = reorder(term, beta)) %>%
          ggplot(aes(term, beta, fill = factor(topic))) +
          geom_col(show.legend = FALSE) +
          facet_wrap(~ topic, scales = "free")
          labs(x = NULL, y = "Beta")
          coord_flip()

花了一些时间在Google上进行研究,并尝试了各种方法,但仍无法确定订单。我希望这些术语按降序排列。请帮忙。谢谢!

enter image description here

1 个答案:

答案 0 :(得分:1)

template can't be null