One option: You can insert latex codes for newline (\
) and table column alignment (&
). Note that each
needs to be "escaped" in R with another
.
stargazer(mod, column.labels='my models\\ & need long titles')
Another way is to multirow. This could be easier for more complex tables with different length headings on each column. You will need to add usepackage{multirow}
to your document preamble.
stargazer(mod, column.labels='\multirow{2}{4 cm}{my models need long titles}')
You will also need to post-edit the latex output from stargazer to insert some extra lines (using \
) below the variable headings so that the rest of the table gets moved down also (as in the exceprt below):
& multirow{2}{4 cm}{my models need long titles} \
\ % note the extra line inserted here before the horizontal rule
hline \[-1.8ex]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…