Learn R Programming

textTools (version 0.1.0)

rm_overlap: Delete rows in a text.table where the records within a group are also found in other groups (overlapping records)

Description

Delete rows in a text.table where the records within a group are also found in other groups (overlapping records)

Usage

rm_overlap(x, text, group_by = c())

Arguments

x

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

text

A string, the name of the column in x to determine deletion of rows based on the presence of overlapping records.

group_by

A vector of column names to group by. Doesn't work if the group by column is a list column.

Value

A text.table, with rows having records found in multiple groups (overlapping records) deleted.

Examples

Run this code
# NOT RUN {
rm_overlap(
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",
group_by = "col1"
)
# }

Run the code above in your browser using DataLab