cleanText: Clean the text

Description Usage Arguments Value Examples

View source: R/helpers.R

Description

Clean the text by removing extra whitespace, normalize to lowercase, remove special characters, and remove unwanted words.

Usage

1
cleanText(input, wordsToRemove = "")

Arguments

input

Character vector to clean.

wordsToRemove

Character vector of words to remove. The default is an empty string.

Value

Cleaned text

Examples

1
2
3
4
input <- c("this is an example", "what will it do!")
remove <- c("example", "it", "the")
cleanText(input, remove)
# returns "this is an"    "what will  do"

justinnafe/NextWord documentation built on May 20, 2019, 5:16 a.m.