Skip to content

Hmisc - latex - table.env not observed

2 messages · Steve, Frank E Harrell Jr

#
The following code

library(Hmisc)
x = 1:10
y = x
latex(summary(x~y),table.env=FALSE)
latex(summary(cbind(x,y)),table.env=FALSE)

should produce latex output that is not a table. The second  one 
produces just a tabular, as it should. However, the first one produces a 
tabular embedded in a table. (This is the effect if you leave 
table.env=FALSE out).
#
steve wrote:
summary(x~y) produces a summary.formula.response object and 
latex.summary.formula.response generates a caption for the table. 
Whenever latex.default sees a caption it sets table.env to TRUE.

You might try the ctable option if you have the ctable style installed 
in LaTeX or we can think about respecting table.env more fully.  But I 
wouldn't know what to do with the caption then.