Description Usage Arguments Value Examples
Add a meta-data variable to a corpus indicating the cluster to which each document belongs.
1 | add_clusters(corpus, clust)
|
corpus |
A |
clust |
A |
A Corpus
object with meta(corpus, "cluster")
indicating the cluster
of each document.
1 2 3 4 5 6 7 | file <- system.file("texts", "reut21578-factiva.xml", package="tm.plugin.factiva")
corpus <- import_corpus(file, "factiva", language="en")
dtm <- build_dtm(corpus)
res <- corpus_ca(corpus, dtm, ncp=2, sparsity=0.98)
clust <- corpus_clustering(res, 3)
corpus <- add_clusters(corpus, clust)
meta(corpus)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.