Learn R Programming

textTools (version 0.1.0)

rm_words: Remove rows from a text.table with specific words

Description

Remove rows from a text.table with specific words

Usage

rm_words(x, text, words = stopwords)

Arguments

x

A text.table created by as.text.table().

text

A string, the name of the column in x to check for words to delete.

words

A vector of words to delete from x.

Value

A text.table, with rows deleted if the words in those rows are in the vector of words to delete.

Examples

Run this code
# NOT RUN {
rm_words(
as.text.table(
  x = as.data.table(
    list(
      col1 = c(
        "a",
        "b"
      ),
      col2 = c(
        tolower("The dog is nice because it picked up the newspaper."),
        tolower("The dog is extremely nice because it does the dishes.")
      )
    )
  ),
  text = "col2",
  split = " "
),
text = "col2"
)
# }

Run the code above in your browser using DataLab