Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get

Extract most likely terms or topics.


Description

Function to extract the most likely terms for each topic or the most likely topics for each document.

Usage

## S4 method for signature 'TopicModel'
terms(x, k, threshold, ...)
## S4 method for signature 'TopicModel'
topics(x, k, threshold, ...)

Arguments

x

Object of class "TopicModel".

k

The maximum number of terms/topics returned. By default set to 1 if no threshold is given.

threshold

Only the terms/topics which are more likely than the threshold are returned.

...

Further arguments passed to sapply.

Value

A list or matrix containing the most likely terms for each topic or the most likely topics for each document.

Author(s)

Bettina Gruen

See Also


topicmodels

Topic Models

v0.2-12
GPL-2
Authors
Bettina Grün [aut, cre] (<https://orcid.org/0000-0001-7265-4773>), Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>), David M Blei [ctb, cph] (VEM estimation of LDA and CTM), John D Lafferty [ctb, cph] (VEM estimation of CTM), Xuan-Hieu Phan [ctb, cph] (MCMC estimation of LDA), Makoto Matsumoto [ctb, cph] (Mersenne Twister RNG), Takuji Nishimura [ctb, cph] (Mersenne Twister RNG), Shawn Cokus [ctb] (Mersenne Twister RNG)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.