rm_no_overlap: Delete rows in a text.table where the records within a group...

Description Usage Arguments Value Examples

View source: R/text.table.R

Description

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

Usage

1
rm_no_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 lack of 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 not having records found in multiple groups (overlapping records) deleted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
rm_no_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"
)

textTools documentation built on Feb. 5, 2021, 5:07 p.m.