library(lda) run.science <- function() { docs <- read.documents("sci90-mult.dat") voc <- readLines("sci90-vocab.dat") # optional: subset the documents # docs <- docs[1:5000] lda.collapsed.gibbs.sampler(docs, 20, voc, 250, 1/20, 0.01) } run.ylj <- function() { docs <- read.documents("ylj-mult.dat") voc <- readLines("ylj-vocab.dat") lda.collapsed.gibbs.sampler(docs, 20, voc, 250, 1/20, 0.01) } example <- function() { run.ylj <- run.ylj() top.topic.words(run.ylj$topics, n=10) }