Change your data frame so that the grouped names have the form <group><separator><name> , and then use the function at the bottom of this answer.
\documentclass{article} \usepackage{booktabs} \begin{document} . <<two-row-headings, results='asis'>>= library(xtable) library(grattanCharts)
The package is exported from the grattanCharts package. But you can use the function yourself:
source share