Check whether x is a permutation of the multi-set s.

is_permutation(x, s)

Arguments

x

[vector]
Input vector to be checked.

s

[vector]
Base set.

Value

A scalar logical value.

Examples

is_permutation(shuffle(1:10), 1:10)
#> [1] TRUE
is_permutation(c(2, 1, 4), s = 1:4)
#> [1] FALSE