Build out n-grams for multiple text inputs and keep the n most frequent combinations.
Usage
ngrams(text, ngram = c(2, 3), top = 10, stop_words = NULL, ...)Arguments
- text
Character vector
- ngram
Integer vector. Number of continuous n items in text.
- top
Integer. Keep n most frequent ngrams only.
- stop_words
Character vector. Words to exclude from text. Example: if you want to exclude "a", whenever that word appears it will be excluded, but when the letter "a" appears in a word, it will remain.
- ...
Additional parameters passed to
remove_stopwords.
See also
Other Text Mining:
cleanText(),
remove_stopwords(),
replaceall(),
sentimentBreakdown(),
textCloud(),
textFeats(),
textTokenizer(),
topics_rake()
