Description Usage Arguments Details Value Author(s) Examples
Pre-processing of raw text. It removes stop-words, punctuations, and create sentence markers.
1 | clean_text(rawText,removeStopwords=F)
|
rawText |
A Vector of strings (tokens) |
removeStopwords |
A boolean: TRUE (remove stop words) - FALSE (it retains them) |
A convenience function that removes unwanted information from a vector of text. The user has, at the moment, an argument to choose whether to remove stop words.
It returns the vector of text all in lower case, and stripped from punctuations and stop-words.
Rick Dale (rdale@ucla.edu)
1 2 3 4 5 6 7 8 9 | library(gutenbergr)
## let's get Alice's Adventures in Wonderland by Carroll
# gutenberg_works(author == "Carroll, Lewis")
rawText = gutenberg_download(11) ## take the text
rawText = as.vector(rawText$text) ## vectorize the text
rawText = paste(rawText, collapse = " ") ## collapse the text
cleanText = clean_text(rawText, removeStopwords = TRUE)
text = cleanText$content
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.