title: How to add multi row headers/column names to a data frame in R
body: <p>I want to represent the table data in a data frame where the table is having multiple headers spanning more than one row as shown below example.</p>
  
  <p><img src="https://i.stack.imgur.com/bFgjP.png" alt="multi-header table"></p>
  
  <p>With data frames, I am able to set only one row of header or column names as below</p>
  
  <pre class="lang-r prettyprint-override"><code>colnames(df) &lt;- c("col1", "col2", ...)
  </code></pre>
  
  <p>Is there a way to give multiple headers or column names to a data frame 
  or is there a better data structure or package available to represent such data structures?</p>