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