I have a dataframe that I am putting into a sweave document using xtable, however one of my column names is quite long, and I would like to break it over two lines to save space
@Sharpie 's technique did not work for me, as pandoc failed with error 43 on conversion to pdf. Therefore, here is what I did:
moved the \\centering
marker:
names(calqc_table)=c(rep("\\multicolumn{1}{p{0.75in}}{\\centering Identifier of the Run within the Study}", 6))
(here applied to all 6 columns of the table)
and disabled sanitization in xtable printing:
print(calqc_table, sanitize.colnames.function=function(x){x})