title: How to obtain all combinations of the columns of a data frame taken by 2?
body: <p>Suppose I have this data frame:</p>
  
  <pre><code>matrix(c(2,4,3,1,5,7,1,2,3,5,8,2,4,5,1,1,3,6,1,3,4,5,6,1),nrow=6,ncol=4,byrow = TRUE)-&gt;X
  as.data.frame(X)-&gt;X.df
  
    V1 V2 V3 V4
  1  2  4  3  1
  2  5  7  1  2
  3  3  5  8  2
  4  4  5  1  1
  5  3  6  1  3
  6  4  5  6  1
  </code></pre>
  
  <p>then I would like to obtain a list of a set of data frames containing all combinations of columns taken by 2,  without repetition, and avoiding any column with itself. That means, a list of dataframes with the following headers:</p>
  
  <pre><code>V1,V2
  V1,V3
  V1,V4
  V2,V3
  V2,V4
  V3,V4
  </code></pre>
  
  <p>Any idea of how to do this?</p>