Here is my data frame: 

> 
> 
> ```
> V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15  
> 1   1  1  1  1  1  1  1  1  1   1   1   1   1   1   1  
> 2   1  1  1  1  1  1  1 -1 -1  -1  -1  -1  -1  -1  -1  
> 3   1  1  1 -1 -1 -1 -1  1  1   1   1  -1  -1  -1  -1 
> 4   1  1  1 -1 -1 -1 -1 -1 -1  -1  -1   1   1   1   1  
> 5   1 -1 -1  1  1 -1 -1  1  1  -1  -1   1   1  -1  -1  
> 6   1 -1 -1  1  1 -1 -1 -1 -1   1   1  -1  -1   1   1  
> 7   1 -1 -1 -1 -1  1  1  1  1  -1  -1  -1  -1   1   1  
> 8   1 -1 -1 -1 -1  1  1 -1 -1   1   1   1   1  -1  -1  
> 9  -1  1 -1  1 -1  1 -1  1 -1   1  -1   1  -1   1  -1  
> 10 -1  1 -1  1 -1  1 -1 -1  1  -1   1  -1   1  -1   1  
> 11 -1  1 -1 -1  1 -1  1  1 -1   1  -1  -1   1  -1   1  
> 12 -1  1 -1 -1  1 -1  1 -1  1  -1   1   1  -1   1  -1  
> 13 -1 -1  1  1 -1 -1  1  1 -1  -1   1   1  -1  -1   1 
> 14 -1 -1  1  1 -1 -1  1 -1  1   1  -1  -1   1   1  -1  
> 15 -1 -1  1 -1  1  1 -1  1 -1  -1   1  -1   1   1  -1  
> 16 -1 -1  1 -1  1  1 -1 -1  1   1  -1   1  -1  -1   1
> 
> ```
> 
> 

First, I use `combn(4:15, 3)` to calculate the combination.

Like this:

> 
> 
> ```
>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] ....      [,220] 
> [1,]    4    4    4    4    4    4    4    4    4     4     4     4     4 ....         13 
> [2,]    5    5    5    5    5    5    5    5    5     5     6     6     6 ....         14  
> [3,]    6    7    8    9   10   11   12   13   14    15     7     8     9 ....         15
> 
> ```
> 
> 

My problem is: How to use the result of `combn(4:15, 3)` and my data set to get a lot of matrix? (in this case, I need 220 matrices because there are 220 combinations.)

Take the first combination for example,
The first combination is: 

```
       [,1]   
[1,]    4      
[2,]    5      
[3,]    6    

```

So I　take column 4, column 5 and column 6 from my data frame to get a new matrix like this:

```
 V4 V5 V6 
1  1  1  1 
2  1  1  1   
3  1 -1 -1 
4  1 -1 -1  
5  -1  1  1 
6  -1  1  1 
7  -1 -1 -1 
8  -1 -1 -1 
9  -1  1 -1 
10 -1  1 -1  
11 -1 -1  1 
12 -1 -1  1 
13  1  1 -1 
14  1  1 -1 
15  1 -1  1  
16  1 -1  1  

```

Does anyone have some simple pieces of code to do this? Thanks for everybody's help!