title: Crosslink values through different rows and columns with R
body: <p>I have two columns of paired ID's as follows:</p>
  <pre><code>  id_a=c(12,15,68663,34,34,34,20,1001) 
    id_b&lt;-c(67764,68663,68667,14,19,1001,20,2112)
    input=data.frame(id_a,id_b)
  </code></pre>
  <p>What I'm struggling to do is cross linking the paired values, so the expected output would look like this:</p>
  <pre><code>output=data.frame(id_linked_1=c(12,14,15,20),id_linked_2=c(67764,19,68663,20),id_linked_3=c(NA,34,68667,NA),id_linked_4=c(NA,1001,NA,NA),id_linked_5=c(NA,2112,NA,NA))
  </code></pre>
  <p>Any suggestions are very appreciated.</p>