[R] Hmisc latex function with longtable option

From: Erik Iverson <iverson_at_biostat.wisc.edu>
Date: Wed, 02 Jul 2008 10:58:25 -0500


Hello -

I'm trying to use Hmisc's latex function to produce a postscript file of a data.frame, using the longtable = TRUE option. When I run, for example,

## sample R code
dvips(latex(data.frame(a = rnorm(100), b = rnorm(100)),

             longtable = TRUE), file = "test.ps")

latex runs successfully and a test.ps file is produced. However, I see the following in the output that the latex command sends to the R buffer.

...

Package longtable Warning: Column widths have changed

(longtable)                in table 1 on input line 121.


Package longtable Warning: Table widths have changed. Rerun LaTeX.
...

And the resulting test.ps file has the column headings not aligned (in my real life example, there are other misalignments).

To resolve this, I am currently going into the /tmp/Rtmp****/ directory where the .tex files are created by the dvi.latex function, and rerunning latex on the appropriate file****.tex file.

Is there any thing I'm missing that would make this easier?

Thanks,
Erik Iverson
iverson_at_biostat.wisc.edu



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. Received on Wed 02 Jul 2008 - 16:01:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 02 Jul 2008 - 17:31:48 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive