Description Usage Arguments Value Examples
View source: R/topic_modeling_utilities.R
Takes topics by terms matrix and returns top M terms for each topic
1 | GetTopTerms(phi, M, return_matrix = TRUE)
|
phi |
A matrix whose rows index topics and columns index words |
M |
An integer for the number of terms to return |
return_matrix |
Do you want a |
If return_matrix = TRUE
(the default) then a matrix. Otherwise,
returns a data.frame
or tibble
whose columns correspond to a topic and
whose m-th row correspond to the m-th top term from the input phi
.
1 2 3 4 5 6 | # Load a pre-formatted dtm and topic model
data(nih_sample_topic_model)
top_terms <- GetTopTerms(phi = nih_sample_topic_model$phi, M = 5)
str(top_terms)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.