I have drawn a graph during LDA analysis, but I want to get the plot in descending order based on the beta value.
ap_topics <- tidy(ap_lda, matrix = "beta")
ap_lda <- LDA(dtm.new, k = 15, control = list(alpha=0.1,seed=1234))
ap_topics <- tidy(ap_lda, matrix = "beta")
ap_top_terms <- ap_topics %>%
group_by(topic) %>%
top_n(15, beta) %>%
ungroup() %>%
arrange(topic, -beta)
ap_top_terms %>%
mutate(term = reorder(term, beta)) %>%
ggplot(aes(term,beta, fill = factor(topic))) +
geom_col(show.legend = FALSE) +
facet_wrap(~ topic, scales = "free") +
coord_flip()
I want to make it easier to see the beta value for each term in the graph. What should I do?
ap_top_term structure
> ap_top_terms
# A tibble: 150 x 3
topic term beta
<int> <chr> <dbl>
1 1 hdr 0.0211
2 1 better 0.0101
3 1 content 0.00979
4 1 dontt 0.00930
5 1 thing 0.00749
6 1 oled 0.00720
7 1 black 0.00625
8 1 model 0.00611
9 1 make 0.00566
10 1 update 0.00556
# ... with 140 more rows
here is my current plot