toLDAvisJson {stm} | R Documentation |
Wrapper to create Json mapping for LDAvis. This can be useful in indirect render e.g. Shiny Dashboards
Description
Tool for exploring topic/word distributions using LDAvis topic browser.
Usage
toLDAvisJson(
mod,
docs,
R = 30,
plot.opts = list(xlab = "PC1", ylab = "PC2"),
lambda.step = 0.1,
reorder.topics = TRUE
)
Arguments
mod |
STM object. Output from stm function. |
docs |
Documents object passed to |
R |
Passed to |
plot.opts |
Passed to |
lambda.step |
Passed to |
reorder.topics |
Passed to |
Details
Tool for exploring topic/word distributions using LDAvis topic browser. Development build of LDAvis available at https://github.com/cpsievert/LDAvis or download from CRAN. Note: LDAvis may renumber the topics.
References
Carson Sievert and Kenny Shirley. LDAvis: Interactive Visualization of Topic Models. R package version 0.3.1. https://github.com/cpsievert/LDAvis
Examples
mod <- stm(poliblog5k.docs, poliblog5k.voc, K=25,
prevalence=~rating, data=poliblog5k.meta,
max.em.its=2, init.type="Spectral")
#please don't run a model with 2 iterations
#this is done here to make it run quickly.
toLDAvisJson(mod=mod, docs=poliblog5k.docs)