get_top_n_beta_terms: get top n beta terms for each topic in an stm topic model

View source: R/get_top_n_beta_terms.R

get_top_n_beta_termsR Documentation

get top n beta terms for each topic in an stm topic model

Description

get the top n beta terms for each topic in an stm topic model

Usage

get_top_n_beta_terms(td_beta_obj, n = 7)

Arguments

td_beta_obj

a tidied beta matrix from the stm topic model of interest. Can be created with topicHelpers::get_td_beta

n

the number of top terms to be returned for each topic

Value

a tbl_df with columns "topic" and "terms"

Examples

## Not run: 
data("tm_ex_dat")

beta_obj <- get_td_beta(tm_ex_dat$topic_model_test)

get_top_n_beta_terms(beta_obj)

## End(Not run)

tknoch8/topicHelpers documentation built on Nov. 11, 2023, 1:15 a.m.