There’s the combn
function in the utils
package:
t(combn(LETTERS[1:3],2))
# [,1] [,2]
# [1,] "A" "B"
# [2,] "A" "C"
# [3,] "B" "C"
I’m a little confused as to why your x
has duplicated values.
There’s the combn
function in the utils
package:
t(combn(LETTERS[1:3],2))
# [,1] [,2]
# [1,] "A" "B"
# [2,] "A" "C"
# [3,] "B" "C"
I’m a little confused as to why your x
has duplicated values.