Learn R Programming

textTools (version 0.1.0)

rm_long_words: Delete rows in a text.table where the word has more than a minimum number of characters

Description

Delete rows in a text.table where the word has more than a minimum number of characters

Usage

rm_long_words(x, text, max_char_length)

Arguments

x

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

text

A string, the name of the column in x used to determine deletion of rows based on the number of characters.

max_char_length

A number, the maximum number of characters allowed to not delete a row.

Value

A text.table, with rows having more than a certain number of characters deleted.

Examples

Run this code
# NOT RUN {
rm_long_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",
max_char_length = 4
)
# }

Run the code above in your browser using DataLab