[R] longtable example
Felipe Carrillo
mazatlanmexico at yahoo.com
Fri Jan 9 19:47:51 CET 2009
Thanks Dieter:
It's exactly what I want. Thanks a lot for you help. One thing that I noticed though, when I generated my pdf all the pages had different numbers of rows, for example page 1 had 24 rows,second page 15 rows,third page 2 rows of data. Is that something that can be controlled with pagebreaks? I am reading about the 'latex' function right now in some cases I will need to print some tables in 'landscape',so is there an option to landscape that particular page instead of just landscaping the table?
--- On Fri, 1/9/09, Dieter Menne <dieter.menne at menne-biomed.de> wrote:
> From: Dieter Menne <dieter.menne at menne-biomed.de>
> Subject: Re: [R] longtable example
> To: r-help at r-project.org
> Date: Friday, January 9, 2009, 10:01 AM
> 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.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
More information about the R-help
mailing list