Description Usage Arguments Details Value Examples
Show terms that are the most associated (positively or negatively) with a reference term.
1 2 3 4 5 6 7 8 9 | cooc_terms(
dtm,
term,
variable = NULL,
p = 0.1,
n = 25,
sparsity = 1,
min_occ = 2
)
|
dtm |
A |
term |
A reference term appearing in |
variable |
An optional vector of values giving the groups for which most frequent terms should be reported. |
p |
The maximum p-value up to which terms should be reported. |
n |
The maximal number of terms to report (for each group, if applicable). |
sparsity |
Value between 0 and 1 indicating the proportion of documents
with no occurrences of a term above which that term should be dropped. By default
all terms are kept ( |
min_occ |
The minimum number of occurrences in the whole |
Co-occurrent terms are those which are specific to documents which contain
the given term. The output is the same as that returned by specific_terms
.
A list of matrices, one for each level of the variable, with columns:
"\ in documents where the chosen term is also present.
"\ where the chosen term is also present (rather than in documents where it does not appear), i.e. the percent of cooccurrences for the term..
"Global \ in the corpus (or in the subset of the corpus corresponding to the variable level).
"Level": the number of cooccurrences of the term.
"Global": the number of occurrences of the term in the corpus (or in the subset of the corpus corresponding to the variable level).
"t value": the quantile of a normal distribution corresponding the probability "Prob.".
"Prob.": the probability of observing such an extreme (high or low) number of occurrences of the term in documents where the chosen term is also present, under an hypergeometric distribution.
1 2 3 4 5 | file <- system.file("texts", "reut21578-factiva.xml", package="tm.plugin.factiva")
corpus <- import_corpus(file, "factiva", language="en")
dtm <- build_dtm(corpus)
cooc_terms(dtm, "barrel")
cooc_terms(dtm, "barrel", meta(corpus)$Date)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.