Learn R Programming

Twitmo (version 0.1.2)

lda_terms: View Terms heavily associated with each topic

Description

Convenience Function to extract the most likely terms for each topic.

Usage

lda_terms(lda_model, n_terms = 10)

Arguments

lda_model

Fitted LDA Model. Object of class LDA).

n_terms

Integer number of terms to return.

Value

Data frame with top n terms for each topic.

Examples

Run this code
# NOT RUN {
library(Twitmo)

# load tweets (included in package)
mytweets <- load_tweets(system.file("extdata", "tweets_20191027-141233.json", package = "Twitmo"))

# Pool tweets into longer pseudo-documents
pool <- pool_tweets(data = mytweets)
pooled_dfm <- pool$document_term_matrix

# fit your LDA model with 7 topics
model <- fit_lda(pooled_dfm, n_topics = 7, method = "Gibbs")

# }

Run the code above in your browser using DataLab