get_superset_list: Get superset for each element in a list

View source: R/grain_compile.R

get_superset_listR Documentation

Get superset for each element in a list

Description

For each element (vector) x in x_set, find the first element (vector) y in y_set such that x is contained in y

Usage

get_superset_list(x_set, y_set, warn = FALSE)

Arguments

x_set

Vector or list of vectors.

y_set

Vector or list of vectors.

warn

Should a warning be made if an element is found.

Examples

x_set <- list(c("a", "b"), "e", c("b", "a"))
y_set <- list(c("f","u", "e"), c("a", "b", "c", "a"), c("b", "c", "a"))
get_superset_list(x_set, y_set)
get_superset_list(letters[1:4], y_set)
get_superset_list(letters[1:4], letters[1:10])
get_superset_list(x_set, letters[1:10])
x_set <- list(c("a", "b"), "e", c("b", "a"), "o")
y_set <- list(c("f","u", "e"), c("a", "b", "c", "a"), c("b", "c", "a"))
get_superset_list(x_set, y_set, warn=TRUE)
get_superset_list(x_set, y_set, warn=FALSE)


gRain documentation built on Nov. 21, 2023, 5:07 p.m.