Let's assume that we have a 10x5 dataset containing 5 chemical measurements(e.g., var1, var2, var3, var4, var5) on 10 wine samples(rows). We'd like to cluster wine samples based on chemical measurements using k means clustering. It's quite easy to do so. However, I'd like to perform consecutive clustering, starting with clustering the wine samples with a single chemical measurements and then performing clustering operations with all combinations of var1, var2, var3, var4 and var5 (all unary, binary, ternary, quarternary and quinary combinations).
To put it differently, I'm interested in clustering the wine samples based on all possible combinations of measurements given in columns which will result in a total of 31 clustering results, e.g., based on (1)var1, (2)var2, (3)var3, (4)var4, (5)var5, (6)var1 and var2, (7)var1 and var3,..., (31)var1, var2, var3, var4 and var5.
How can I create such a loop in R ?