dot-sharedSubstr: Group based on shared substrings

.sharedSubstrR Documentation

Group based on shared substrings

Description

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))

HelenLindsay/AbNames documentation built on June 6, 2023, 1:18 p.m.