Unfortunately no... Allcombi give me an error when I use a N>k where k are the number of possible combinations between X and Y, that's cause it computes the number of combinations of K elements taken N at a time. While the Do loop of ballardw and your code give all the possible combinations between X and Y, but what I need is every possible dataset that contains not only all the combination of X and Y, but also simulate other data (which are other combination of X and Y) for a given N sample size. Basically every dataset/tables is unique and should contain at least once every combinations of X and Y plus other data that can assume the combination of X and Y. For example if i have N=5 X=(0, 1) Y=(0, 1) the dataset that I should have are: X Y X Y X Y X Y 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 The order doesn't count so all that matters are the frequencies of the data. Other dataset like: X Y 0 0 0 0 0 0 1 0 0 1 have N sample size, but it doesn't contain all the possible combination of X and Y I hope that I had explained better... Thank you for the interesting
... View more