Description Usage Arguments Value Examples
A function to create an n-gram model from a tidy data frame. It is a convenience function based around tidytext functions
1 | create_ngrams(corpus, ngram_size, stopwords)
|
corpus |
A data frame containing columns for title and text |
ngram_size |
An character string denoting the size of n-gram (unigram, bigram or trigram) |
stopwords |
A data frame containing stop words |
A data frame of ngrams
1 2 3 4 | library(janeaustenr)
library(tidytext)
unigrams <- create_ngrams(austen_books(),"unigram")
stopped <- create_ngrams(austen_books(),"unigram",stopwords=stop_words)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.