title: Using merge command in r for merging depending upon column values
body: <p>So, I have several dataframes like this</p>
  
  <pre><code>1 2 a
  2 3 b
  3 4 c
  4 5 d
  3 5 e
  ......
  
  1 2 j
  2 3 i
  3 4 t
  3 5 r
  .......
  
  2 3 t
  2 4 g
  6 7 i
  8 9 t
  ......
  </code></pre>
  
  <p>What I want is, I want to merge all of these files into one single file showing the values of third column for each pair of values in columns 1 and columns 2 and 0 if that pair is not present.</p>
  
  <p>So, the output for this will be, since, there are three files (there are more)</p>
  
  <pre><code>1 2 aj0
  2 3 bit
  3 4 ct0
  4 5 d00
  3 5 er0
  6 7 00i
  8 9 00t
  ......
  </code></pre>
  
  <p>What I did was combine all my text <code>.txt</code> files in a single list.
  Then, </p>
  
  <pre><code>L &lt;- lapply(seq_along(L), function(i) { 
    L[[i]][, paste0('DF', i)] &lt;-  1
    L[[i]] 
  })
  </code></pre>
  
  <p>Which will indicate the presence of a value when we will be merging them. 
  I don't know how to proceed further. Any inputs will be great. Thanks!</p>