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