[R] Several problems with hmisc latex function

Erich Studerus, Psychiatrische Uni-Klinik erich.studerus at bli.uzh.ch
Sat Oct 18 13:46:58 CEST 2008


I'm having several problems with the Hmisc latex function. First, there 
seems to be a conflict between the cellTexCmds and the cgroupTexComds. When 
I'm using both at the same time, I get an error message. Here's an example. 
I just added cellTexComds to the example on page 10 of this document:

x <- matrix(1:30, ncol = 5)
y <- letters[1:6]
x <- data.frame(x, y)
cell.format <- matrix(rep("", NCOL(x) * NROW(x)), ncol = NCOL(x))

latex(x, file = "", cgroup = c("Group A", "Group B", "Group C"), n.cgroup = 
c(2, 2, 2), rgroup = c("First", "Second"), n.rgroup = c(4, + 2), 
colnamesTexCmd = "color{green}", cgroupTexCmd = "scshape", rgroupTexCmd = 
"bfseries", numeric.dollar = FALSE, title = "", ctable = TRUE, label = 
"tab:severalCgroups", caption = "More than two column 

I also would like to add more space between the column names and the line 
above them. With the defaults the column names are extremly close to the 
line. Adding "\\vspace{5mm} works, but adds the space below the names and 
not on top of the names, where I want to put it.

I'm also struggling with the dcolumn option. Can anyone give a reproducible 
example for this option. I tried


but it does not work.

Thanks for your help!


More information about the R-help mailing list