title: r - use kable to group columns with sub columns having the same name
body: <p>I am trying to use <code>kable</code> and <code>kableextra</code> to create a table that has different grouped headers but the same column names in the sub-headers</p>
  
  <p>For example, if you look at the section "Grouped Columns/Headers" (page 14) of <a href="http://haozhu233.github.io/kableExtra/awesome_table_in_pdf.pdf" rel="nofollow noreferrer">Create Awesome LaTeX Table with knitr::kable andkableExtra</a> it is grouped but the sub-header names are different:</p>
  
  <pre><code>library(knitr)
  library(kableExtra)
  dt &lt;- mtcars[1:5, 1:6]
  
  kable(dt, "latex", booktabs = T) %&gt;%
  kable_styling() %&gt;%
  add_header_above(c(" " = 1, "Group 1" = 2, "Group 2" = 2, "Group 3" = 2))
  </code></pre>
  
  <p>What I am trying to do is something like this with the cars as groups (only using two cars for example):</p>
  
  <pre><code>Mazda RX4 | Datsun 710
  ----------------------
  mpg | cyl | mpg | cyl
  ----------------------
  21.0|   6 | 21.4|   6
  </code></pre>
  
  <p>or as another example:</p>
  
  <pre><code>Group 1 | Group 2
  ------------------
  x  |  y | x  |  y
  ------------------
  a  |  1 | b  |  2
  c  |  3 | d  |  4
  </code></pre>
  
  <p>Is this possible?</p>