Generate counts for the most frequent n-grams in text.Source:
Function returns a list with a viz and a view object. The viz object can be fed into ParseR's `viz_ngram` function to produce a network visualisation.
count_ngram( df, text_var = Message, n = 2, top_n = 50, min_freq = 10, distinct = FALSE, hashtags = FALSE, mentions = FALSE, clean_text = FALSE, remove_stops = TRUE, ... )
The variable containing the text.
The number of terms to include in the n-gram. E.g. 2 produces a bi-gram.
The number of n-grams to include.
The minimum number of times an n-gram must be observed to be included.
If TRUE, will count # of unique posts for each n-gram.
Should hashtags be included in the n-grams?
Should mentions be included in the n-grams?
Should the text variable be cleaned?
Should stopwords be removed?
fed to the `ParseR::clean_text()` function