contributive_docs | R Documentation |
Print documents which contribute the most to an axis of correspondence analysis.
contributive_docs(corpus, ca, axis, ndocs = 10, nterms = 25)
corpus |
A |
ca |
A |
axis |
The CA axis to consider. |
ndocs |
The number of (most contributive) documents to print. |
nterms |
The number of terms to highlight in documents. |
Occurrences of the nterms
most contributive terms are highlighted.
If stemming or other transformations have been applied to original words
using combine_terms
, all original words which have been transformed
to the specified terms are highlighted.
Corpus
object (invisibly).
file <- system.file("texts", "reut21578-factiva.xml", package="tm.plugin.factiva")
corpus <- import_corpus(file, "factiva", language="en")
dtm <- build_dtm(corpus)
ca <- corpus_ca(corpus, dtm)
contributive_docs(corpus, ca, 1)
# Also works when terms have been combined
dict <- dictionary(dtm)
dtm2 <- combine_terms(dtm, dict)
ca2 <- corpus_ca(corpus, dtm2)
contributive_docs(corpus, ca2, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.