Last chance! 50% off unlimited learning
Sale ends in
Remove all stop-words and specific patterns from a character vector
remove_stopwords(text, stop_words, exclude = NULL, sep = " ")
Character vector
Character vector. Words to exclude from text. Example: if you want to exclude "a", whenever that word appears it will be excluded, but when the letter "a" appears in a word, it will remain.
Character. Pattern to exclude using regex.
Character. String that separate the terms.
Character vector with removed texts.
Other Text Mining:
cleanText()
,
ngrams()
,
replaceall()
,
sentimentBreakdown()
,
textCloud()
,
textFeats()
,
textTokenizer()
,
topics_rake()
# NOT RUN {
x <- c("A brown fox jumps over a dog.", "Another brown dog.")
remove_stopwords(x, stop_words = c("dog", "brown", "a"), exclude = "\\.")
# }
Run the code above in your browser using DataLab