title: Table output - grouping column headings for PDF table
body: <p>I'd like to know if there's any way of effectively grouping column headings when outputting a summary table. I realise that's a terrible explanation of what I want so here's an example.</p>
  
  <p>Let's say I have a summary dataframe with 5 columns: projectName, currMonthCost, currMonthRev, prevMonthCost, prevMonthRev. I'd like to have 2 levels to the column headings, with the final output to group the columns by curr/prev - something like:</p>
  
  <pre><code>               ||     Current    ||    Previous    ||  
    projectName  ||  Cost  |  Rev  ||  Cost  |  Rev  ||
  _______________||________|_______||________|_______||
                 ||        |       ||        |       ||
         x       ||    x   |   x   ||    x   |   x   ||  
         y       ||    y   |   y   ||    y   |   y   ||
  </code></pre>
  
  <p>Apologies for the poor attempt at making a table, I'm new here. But hopefully you get the idea.</p>
  
  <p>Is there a package that can handle that? I'm already using formattable but can't find anything obvious in there. I'm happy for it to be a complete botch if there's nothing ready made - it's only summary numbers getting exported to PDF. I just want to avoid having to export to excel to merge cells before PDFing.</p>
  
  <p>Thanks in advance.
  James</p>