Learn R Programming

diyar (version 0.5.1)

combi: Vector combinations

Description

Numeric codes for unique combination of vectors.

Usage

combi(...)

Value

numeric

Arguments

...

[atomic]

Examples

Run this code
x <- c("A", "B", "A", "C", "B", "B")
y <- c("X", "X", "Z", "Z", "X", "Z")
combi(x, y)

# The code above is equivalent to but quicker than the one below.
z <- paste0(y, "-", x)
z <- match(z, z)
z

Run the code above in your browser using DataLab