title: Combine Multiple Columns Into Tidy Data
body: <p>My dataset looks like this:</p>
  
  <pre><code>unique.id abx.1    start.1     stop.1 abx.2    start.2     stop.2 abx.3    start.3     stop.3 abx.4    start.4
  1         1  Moxi 2014-01-01 2014-01-07  PenG 2014-01-01 2014-01-07 Vanco 2014-01-01 2014-01-07  Moxi 2014-01-01
  2         2  Moxi 2014-01-01 2014-01-02 Cipro 2014-01-01 2014-01-02  PenG 2014-01-01 2014-01-02 Vanco 2014-01-01
  3         3 Cipro 2014-01-01 2014-01-05 Vanco 2014-01-01 2014-01-05 Cipro 2014-01-01 2014-01-05 Vanco 2014-01-01
  4         4 Vanco 2014-01-02 2014-01-03 Cipro 2014-01-02 2014-01-03 Cipro 2014-01-02 2014-01-03  PenG 2014-01-02
  5         5 Vanco 2014-01-01 2014-01-02  PenG 2014-01-01 2014-01-02  PenG 2014-01-01 2014-01-02 Cipro 2014-01-01
        stop.4    intervention
  1 2014-01-07       0
  2 2014-01-02       0
  3 2014-01-05       1
  4 2014-01-03       1
  5 2014-01-02       0
  </code></pre>
  
  <p>With some code to create this:</p>
  
  <pre><code> abxoptions &lt;- c("Cipro", "Moxi", "PenG", "Vanco")
        df3 &lt;- data.frame(
        unique.id = 1:5,
        abx.1 = sample(abxoptions,5, replace=TRUE),
        start.1 = as.Date(c('2014-01-01', '2014-01-01', '2014-01-01', '2014-01-02', '2014-01-01')),
        stop.1  = as.Date(c('2014-01-07', '2014-01-02', '2014-01-05', '2014-01-03', '2014-01-02')),
        abx.2 = sample(abxoptions,5, replace=TRUE),         
        start.2 = as.Date(c('2014-01-01', '2014-01-01', '2014-01-01', '2014-01-02', '2014-01-01')),
        stop.2  = as.Date(c('2014-01-07', '2014-01-02', '2014-01-05', '2014-01-03', '2014-01-02')),
        abx.3 = sample(abxoptions,5, replace=TRUE),         
        start.3 = as.Date(c('2014-01-01', '2014-01-01', '2014-01-01', '2014-01-02', '2014-01-01')),
        stop.3  = as.Date(c('2014-01-07', '2014-01-02', '2014-01-05', '2014-01-03', '2014-01-02')),
        abx.4 = sample(abxoptions,5, replace=TRUE),         
        start.4 = as.Date(c('2014-01-01', '2014-01-01', '2014-01-01', '2014-01-02', '2014-01-01')),
        stop.4  = as.Date(c('2014-01-07', '2014-01-02', '2014-01-05', '2014-01-03', '2014-01-02')),
        intervention = c(0,0,1,1,0)
  </code></pre>
  
  <p>)</p>
  
  <p>I would like to tidy this data to look like this:</p>
  
  <pre><code>unique.id    abx     start    stop           intervention
  1            Moxi    2014-01-10 2014-01-07      0
  1            Pen G   2014-01-01 2014-01-07      0
  1            Vanco   2014-01-01 2014-01-07      0
  1            Moxi    2014-01-01 2014-01-07      0  etc etc
  </code></pre>
  
  <p>The following solutions didn't get me where I needed:
  <a href="https://stackoverflow.com/questions/25925556/gather-multiple-sets-of-columns-with-tidyr">Gather multiple sets of columns</a> and
  <a href="https://stackoverflow.com/questions/27902550/combining-multiple-columns-into-one">Combining multiple columns into one</a></p>
  
  <p>I suspect that Hadley's amazing tidyr pakcage is the way to go...just can't figure this out.  Any help would be greatly appreciated.</p>