这是一个来自?latex.table.by
in the taRifx
包裹。你可以使用类似的方法来酿造类似的东西longtable
在 LaTeX 中并使用latex.table.by
代码作为原型。
my.test.df <- data.frame(grp=rep(c("A","B"),10),data=runif(20))
library(xtable)
latex.table.by(my.test.df)
# print(latex.table.by(test.df), include.rownames = FALSE, include.colnames = TRUE, sanitize.text.function = force)
# then add \usepackage{multirow} to the preamble of your LaTeX document
# for longtable support, add ,tabular.environment='longtable' to the print command (plus add in ,floating=FALSE), then \usepackage{longtable} to the LaTeX preamble
无论如何,longtable
LaTeX 中的包是关键。
编辑:看来您的列太多,而不是行太多。在这种情况下,首先尝试仅美化该页面。
在标题中:
\usepackage{lscape}
你的桌子周围:
\begin{landscape}
...
\end{landscape}
或者只是使用sidewaystable
.
如果您的表格太宽而无法在一页中容纳,请尝试supertabular
包,从描述来看,它可能会根据宽度处理跨多个页面的情况(但我从未使用过它,所以不能确定)。