xtable with longtable is doublespaced, rather than single as intended

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xtable with longtable is doublespaced, rather than single as intended

Stephen J. Barr-2
Hello,

Quick R/LaTeX question.

I have the following code within a .Rnw file:

<<label=regionalSummary,results=tex,echo=false>>=
cVec <- c("RATE","SVC.PCT","AGR.PCT","IND.PCT","density00")
x.big <- xtable(aggregate(qp3[,cVec], list(qp3[,"COURT"]), mean))
colnames(x.big)[1] <- "COURT"
print(x.big, tabular.environment="longtable", include.rownames=TRUE)
@

However, in the PDF the table comes out double spaces, rather than
single spaced like in the xtableGallery document. Is there any way to
force single space behavior. I have nothing strange in my .Rnw file.

Thanks,
-stephen

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: xtable with longtable is doublespaced, rather than single as intended

Stephen J. Barr-2
Found the answer. It seems to work to wrap longtables with this set of commands:

\renewcommand{\arraystretch}{0.6}
% make a longtable
%...
\renewcommand{\arraystretch}{1.0}

Hope this is useful to someone else.

On Mon, Jun 15, 2009 at 5:33 PM, Stephen J. Barr<[hidden email]> wrote:

> Hello,
>
> Quick R/LaTeX question.
>
> I have the following code within a .Rnw file:
>
> <<label=regionalSummary,results=tex,echo=false>>=
> cVec <- c("RATE","SVC.PCT","AGR.PCT","IND.PCT","density00")
> x.big <- xtable(aggregate(qp3[,cVec], list(qp3[,"COURT"]), mean))
> colnames(x.big)[1] <- "COURT"
> print(x.big, tabular.environment="longtable", include.rownames=TRUE)
> @
>
> However, in the PDF the table comes out double spaces, rather than
> single spaced like in the xtableGallery document. Is there any way to
> force single space behavior. I have nothing strange in my .Rnw file.
>
> Thanks,
> -stephen
>

______________________________________________
[hidden email] 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.