[R] longtable example

Dieter Menne dieter.menne at menne-biomed.de
Fri Jan 9 19:01:49 CET 2009




Felipe Carrillo wrote:
> 
> This is what I got.
> 
> \documentclass[11pt]{article}
> \usepackage{longtable,lscape}
> \usepackage{accents}
> \usepackage[usenames,dvipsnames]{color} % load all the colors
> \title{\color{Blue}How to transfer column names and add captions to pages
> in document}
> ...
> 

The example you provided did not work, because you forgot the
library(xtable).
I cannot help you with xtable because I normally use latex in Hmisc; see
below

Dieter

-----------------

\documentclass[11pt]{article}
\usepackage{longtable,lscape}
\usepackage[usenames,dvipsnames]{color} % load all the colors
\title{\color{Blue}How to transfer column names and add captions to pages in
document}
\begin{document}
\maketitle
<<tab.R,echo=FALSE,results=tex>>=
library(Hmisc)
#library(xtable)
x <- matrix(rnorm(1000), ncol = 10)
x.big <- data.frame(x)
latex(x.big,"",file="",longtable=TRUE, dec=2,
  caption='Example of longtable spanning several pages')
#x.big <- xtable(x,label='big',align="c|cccccccccc|",
#  caption='Example of longtable spanning several pages')
#print(x.big,tabular.environment='longtable',
#  latex.environments=c("center"),include.rownames=FALSE,floating=FALSE)
@
I want to add the column headers from the first page to the rest of the
pages
and the caption 'Continued' to the top of each page. Thanks
\end{document}



-- 
View this message in context: http://www.nabble.com/longtable-example-tp21356712p21377352.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list