I am looking for a function that takes one list (of numbers, characters or any kind of objects) and returns two vectors (or a list of vectors) which represents all possible interactions (we might apply the function table(..)
on these outputs).
> my.fun(list(1,2)) # returns the following
> c(1)
> c(2)
> my.fun(list('a','b','c')) # returns the following
> c('a','a','b')
> c('b','c','c')
> my.fun(list('a','b','c','d')) # returns the following
> c('a','a','a','b','b','c')
> c('b','c','d','c','d','d')
Does it make sense?