I am trying to write a program in R which, when a vector is given, will return all possible tuples elements from that vector.
For example: tuples (c ('a', 'b', 'c')) = c ('a', 'b', 'c'); Taxi'); c ('a', 'c'), c ('b', 'c'); c ('a'); s ('b'); s ('s')
I think it should return a list of vectors.
For reference, here is a program that performs a similar function in Stata .
source
share