Extract n-grams from the input tweets data

extract_ngram(tweets, n = 3)

Arguments

tweets

A vector of tweets

n

Length of n-grams to be created Default is 3. n-grams of length 3 will be created

Value

Vector of n-grams

Examples

tweets <- c(
   "Make", "America", "Great", "Again", "DonaldTrump"
)
extract_ngram(tweets, n=3)
#> [1] "Make America Great"      "America Great Again"    
#> [3] "Great Again DonaldTrump"