Question

I want to have column names on each page of the xtable.

\documentclass{article}
\usepackage{graphicx}   
\usepackage{longtable}

\begin{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

Was it helpful?

Solution

I think this is really a LaTeX question, which I simply Googled and ended up with a simple answer from tex.stackexchange.com here.

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 "))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top