Description Usage Arguments Author(s) Examples
An easy way to update stopword lists with new words. Either update preloaded stopwords lists, i.e. "en" or "SMART" or update your own custom stopwords list.
1 | UpdateStopwords(words, stopword.set = "en")
|
words |
a vector of words, formatted as strings, to add to the 'stopword.set'. |
stopword.set |
choose a preloaded stopwords list, i.e. "en" (default) or "SMART" or a vector of custom stopwords. |
Amelia McNamara, James Molyneux
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Example using the "en" stopword list
data("crude") # Load text data
WordFreqTable(crude, top = 10) # Notice the top 10 words
crude <- ProcessText(crude, removestopwords = TRUE) # Remove the "en" stopwords
WordFreqTable(crude, top = 10) # Notice the new top 10 words
WordsToInclude <- c("said", "mln", "bpd", "dlrs") # Words we want to include in our stoplist
UpdatedStopwords <- UpdateStopwords(words = WordsToInclude) # Add words to "en" stoplist
crude <- ProcessText(crude, stopwords.list = UpdatedStopwords, removestopwords = TRUE)
WordFreqTable(crude, top = 10) # Notice the new top 10 words
## Example using the "SMART" stopword list
data("crude") # Load text data
WordFreqTable(crude, top = 10) # Notice the top 10 words
crude <- ProcessText(crude, stopwords.list = stopwords("SMART"), removestopwords = TRUE) # Remove the "SMART" stopwords
WordFreqTable(crude, top = 10) # Notice the new top 10 words
WordsToInclude <- c("mln", "bpd", "dlrs") # Words we want to include in our stoplist
UpdatedStopwords <- UpdateStopwords(words = WordsToInclude, stopword.set = "SMART") # Add words to "SMART" stoplist
crude <- ProcessText(crude, stopwords.list = UpdatedStopwords, removestopwords = TRUE)
WordFreqTable(crude, top = 10) # Notice the new top 10 words
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.