ProcessText: Process text

Description Usage Arguments Value Author(s) See Also Examples

Description

Process text that has been initialized to work as text in R.

Usage

1
ProcessText(text, stopwords.list = stopwords("en"), lower = TRUE, removepunctuation = TRUE, removenumbers = TRUE, removewhitespace = FALSE, removestopwords = FALSE, stemwords = FALSE)

Arguments

text

a text object that has been initialized using the InitializeText function.

stopwords.list

Specify a stopwords.list you would like to use. You can either specify a custom list or a preloaded list, like "en" or "SMART" by using the 'stopwords()' function.

lower

logical. Do you want to convert all the words to lower case? If so, leave the default as TRUE

removepunctuation

logical. Do you want to remove punctuation? If so, leave the default as TRUE

removenumbers

logical. Do you want to remove numbers? If so, leave the default as TRUE

removewhitespace

logical. Do you want to remove whitespace, like spaces and tabs? If so, change the default by passing TRUE

removestopwords

logical. Do you want to remove stopwords, like "and" and "the"? If so, change the default by passing TRUE

stemwords

logical. Do you want to "stem" words, changing both "walking" and "walked" to "walk"? If so, change the default by passing TRUE

Value

Returns a processed text file with the requested transformations performed.

Author(s)

Amelia McNamara

See Also

tm_map, InitializeText

Examples

1
2
3
data(crude)
ProcessText(crude)
PricessText(crude, stopwords.list = "SMART", removestopwords = TRUE)

mobilizingcs/MobilizePrime documentation built on May 23, 2019, 5:07 a.m.