Skip to contents

Takes a vector of words and a corresponding vector of group ids and returns a numeric vector indicating groupings where members of a group share a word with at least one other member of the group.

Usage

.sharedSubstr(x, id)

Arguments

x

Character vector of words

id

Vector of group ids

Examples

# "fox" occurs in groups 1 and 3, and "box" occurs in groups 3 and 4,
# so these groups are grouped together
AbNames:::.sharedSubstr(c("fox", "cat", "fox", "in", "box", "box"),
c(1, 2, 3, 3, 3, 4))
#> [1] 1 2 1 1 1 1