vincent chouraki
2009-Aug-19 20:37 UTC
[R] [Hmisc] latex() with ctable=T inserting unwanted empty line in .tex file when used on summary.formula(method="reverse") object
Dear useRs, When I'm using Hmisc's latex() function with ctable=TRUE on a summary.formula with method="reverse" object and saving in a .tex file, the latter contains an unwanted empty line which makes compilation fail. Here is a brief example : library(Hmisc) test <- data.frame(a=sample(1:30,10),b=sample(c("good","bad","ugly"),10,replace=T)) base <- latex(summary(b~a,data=test,method="reverse"),ctable=T,file="test.tex")> readLines("test.tex")[1:5][1] "% latex.default(cstats, title = title, caption = caption, rowlabel = rowlabel, col.just = col.just, numeric.dollar = FALSE, insert.bottom = legend, rowname = lab, dcolumn = dcolumn, extracolheads = extracolheads, extracolsize = Nsize, ...) " [2] "%" [3] "\\ctable[ caption={Descriptive Statistics by b}, label=summary, pos=!tbp, ]{lccc} {\\tnote[]{\\noindent {\\scriptsize $a$\\ }{$b$\\ }{\\scriptsize $c$\\ } represent the lower quartile $a$, the median $b$, and the upper quartile $c$\\ for continuous variables.}} {\\FL\\multicolumn{1}{l}{}&\\multicolumn{1}{c}{bad}&\\multicolumn{1}{c}{good}&\\multicolumn{1}{c}{ugly}\\NN" [4] "" [5] "&\\multicolumn{1}{c}{{\\scriptsize $N=2$}}&\\multicolumn{1}{c}{{\\scriptsize $N=1$}}&\\multicolumn{1}{c}{{\\scriptsize $N=7$}}\\NN" etc line 4 is the empty line that makes compilation fails... when suppressed in the .tex file, compilation runs without any problem. Is it a bug or is there an option I did not see in ?latex to fix this issue? I did not find any clue in R-Seach so... Thanks for your help!> version_ platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 2 minor 9.1 year 2009 month 06 day 26 svn rev 48839 language R version.string R version 2.9.1 (2009-06-26) ________________________________ Vincent Chouraki, Interne de santé publique, INSERM UMR 744, Institut Pasteur de Lille, France, Site web : www.santepub-lille.fr [[alternative HTML version deleted]]
Dieter Menne
2009-Aug-20 06:44 UTC
[R] [Hmisc] latex() with ctable=T inserting unwanted empty line in .tex file when used on summary.formula(method="reverse") object
Vincent Chouraki wrote:> > > When I'm using Hmisc's latex() function with ctable=TRUE on a > summary.formula with method="reverse" object and saving in a .tex file, > the latter contains an unwanted empty line which makes compilation fail. > > > ... Example removed >Vincent, I checked it and think it is a bug. I have forwarded this to the maintainer, Thomas Dupong, with a cc to Frank Harrell. Dieter -- View this message in context: http://www.nabble.com/-Hmisc--latex%28%29-with-ctable%3DT-inserting-unwanted-empty-line-in-.tex-file-when-used-on-summary.formula%28method%3D%22reverse%22%29-object-tp25051531p25056786.html Sent from the R help mailing list archive at Nabble.com.
vincent chouraki
2009-Aug-21 09:06 UTC
[R] [Hmisc] latex() with ctable=T inserting unwanted empty line in .tex file when used on summary.formula(method="reverse") object
>Vincent Chouraki wrote: >> >> >> When I'm using Hmisc's latex() function with ctable=TRUE on a >>summary.formula with method="reverse" object and saving in a .tex file, >> the latter contains an unwanted empty line which makes compilation fail. >> >> >>... Example removed >> > >Vincent, > >I checked it and think it is a bug. I have forwarded this to the maintainer, >Thomas Dupong, with a cc to Frank Harrell. > >DieterThank you! I'm using this code in the meantime write ( readLines ( "test.tex" ) [ readLines ( "test.tex" ) != "" ] , file = "testbis.tex" , sep = "\n" ) ________________________________ Vincent Chouraki, Interne de santé publique, INSERM UMR 744, Institut Pasteur de Lille, France, Site web : www.santepub-lille.fr [[alternative HTML version deleted]]