Numeric codes for unique combination of vectors.

combi(...)

Arguments

...

[atomic]

Value

numeric

Examples

x <- c("A", "B", "A", "C", "B", "B")
y <- c("X", "X", "Z", "Z", "X", "Z")
combi(x, y)
#> [1] 1 2 3 4 2 5

# The code above is equivalent to but quicker than the one below.
z <- paste0(y, "-", x)
z <- match(z, z)
z
#> [1] 1 2 3 4 2 6