title: How can I divide a dataframe on the basis of values in its columns?
body: <p>So, I have a dataframe like this,</p>
  
  <pre><code>1 2 110 10  NA  NA
  2 3 101 100 NA  NA
  3 4 10  NA  NA  NA
  3 2 110 100 101 NA
  .................
  </code></pre>
  
  <p>Now, I want to divide this dataframe into individual files as 110,10,101,100,10,101..
  And each file contains the first two columns which are present in it. 
  For example,
  The file 110 will contain,</p>
  
  <pre><code>1 2
  3 2
  </code></pre>
  
  <p>And the file, 10 will contain,</p>
  
  <pre><code>1 2
  3 4
  </code></pre>
  
  <p>Like this, I want to divide it. I know how to divide it on the basis of only column value, but since the file contains multiple columns, I don't know how to do it?
  Any help would be appreciated. </p>
  
  <p>The code that I was able to make for single column is and then create text files was,</p>
  
  <pre><code>X &lt;- split(myFile, myFile[, 4])  
  invisible(lapply(names(X), function(y) 
    write.table(X[[y]], file = paste0(y, ".txt"))))
  </code></pre>