Check if vector x is sub- or super-set of vector y.

is_subset(x, y, strict = FALSE)

is_superset(x, y, strict = FALSE)

Arguments

x

[vector]
First vector.

y

[vector]
Second vector.

strict

[logical]

Value

A single logical value.

Examples

x = c(1, 2, 3, 6, 7, 8) y = 1:10 is_subset(x, y)
#> [1] TRUE
is_subset(y, x)
#> [1] FALSE
is_superset(x, y)
#> [1] FALSE
is_superset(y, x)
#> [1] TRUE