在 Sweave 中使用 xtable 的每页上的列名 [英] Column names on each page with xtable in Sweave
本文介绍了在 Sweave 中使用 xtable 的每页上的列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在 xtable 的每一页上都有列名.
I want to have column names on each page of the xtable.
documentclass{article}
usepackage{graphicx}
usepackage{longtable}
egin{document}
<<>>=
x <- matrix(rnorm(1000), ncol = 10)
x.big <- xtable(x,label='tabbig',caption='Example of longtable spanning several pages')
@
<<label = tabSEM.S, echo = FALSE, results = tex >>=
print(x.big,tabular.environment='longtable',floating=FALSE)
@
end{document}
任何帮助将不胜感激.谢谢
Any help will be highly appreciated. Thanks
推荐答案
我认为这确实是一个 LaTeX 问题,我只是简单地用 Google 搜索了一下,最后从 tex.stackexchange.com 得到了一个简单的答案 这里.
I think this is really a LaTeX question, which I simply Googled and ended up with a simple answer from tex.stackexchange.com here.
试试这个(在 LaTeX 中未经测试;如果它编译成你想要的方式会很好奇):
Try this (untested in LaTeX; will be curious if this compiles the way you want):
print(x.big,tabular.environment='longtable',
floating=FALSE,
hline.after = c(-1,nrow(x.big)),
add.to.row = list(pos = list(0),command = "\hline \endhead "))
这篇关于在 Sweave 中使用 xtable 的每页上的列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文