I want to apply exactly what's done in this question but in my case I have a list instead of one vector.
My code is the following:
X_ess <- list(c('a','b','c'),c('d','e','f'))
x <- seq_along(X_ess)
xi <- unlist(lapply(x, function(n) combn(x, n, simplify=FALSE)), recursive=FALSE)
lapply(xi, function(i) X_ess[i])
it doesn't return what it is expected. It would return all possible tuples for each element in my list: (a,b),(a,c),(b,c),......,(e,f).
EDIT My output should look like this:
[1] "a" "b"
[2] "a" "c"
[3] "b" "c"
[4] "d" "e"
[5] "d" "f"
[6] "e" "f"