if (require("lda")) {
data("cora.documents", package = "lda")
data("cora.vocab", package = "lda")
dtm <- ldaformat2dtm(cora.documents, cora.vocab)
cora <- dtm2ldaformat(dtm)
all.equal(cora, list(documents = cora.documents,
vocab = cora.vocab))
}
Run the code above in your browser using DataLab