Get startedGet started for free

Tidying LDA output

We've loaded the LDA output lda_out from the previous exercise. While there are a number of things of interest in the output, the topics themselves are of general interest. Let's extract these values.

This exercise is part of the course

Introduction to Text Analysis in R

View Course

Exercise instructions

  • Print a summary of the topic model output using glimpse().
  • Tidy the matrix of word probabilities.
  • Arrange the topics by word probabilities in descending order.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Glimpse the topic model output
___(___)

# Tidy the matrix of word probabilities
lda_topics <- ___ %>% 
  ___(__)

# Arrange the topics by word probabilities in descending order
___ %>% 
  ___(___)
Edit and Run Code