Description Usage Arguments Value See Also Examples
Find a important ngram (2-3) collocations. Wraps collocations
to provide stopword, min/max characters, and stemming with a generic plot
function.
1 2 3 4 5 6 7 8 9 10 11 12 |
text.var |
A vector of character strings. |
n |
The number of rows to include. |
gram.length |
The length of ngram to generate (2-3). |
stopwords |
A vector of stopwords to exclude. |
min.char |
The minimum number of characters a word must be (including apostrophes) for inclusion. |
max.char |
The maximum number of characters a word must be (including apostrophes) for inclusion. |
order.by |
The name of the measure column to order by: |
stem |
logical. If |
language |
The stem language to use (see |
... |
Other arguments passed to |
Retuns a data.frame of terms and frequencies.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
x <- presidential_debates_2012[["dialogue"]]
ngram_collocations(x)
ngram_collocations(x, n = 50)
ngram_collocations(x, stopwords = c(stopwords::stopwords("english"), "american", "governor"))
ngram_collocations(x, gram.length = 3)
ngram_collocations(x, gram.length = 3, stem = TRUE)
ngram_collocations(x, order.by = "lambda")
plot(ngram_collocations(x))
plot(ngram_collocations(x, n = 40))
plot(ngram_collocations(x, order.by = "lambda"))
plot(ngram_collocations(x, gram.length = 3))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.