Skip to content

"latex" in Hmisc: cell formating

1 message · Tao Shi

#
Hi Dieter,

Thank you for pointing out the website.  From the website it seems the bug has been fixed early 2008 (see http://biostat.mc.vanderbilt.edu/trac/Hmisc/changeset/582 ).

So I upgraded my Hmisc package to 3.4-4, which was published on 11/3/2008 and hoped it would work.  However, the problem persisted.


...Tao



Tao Shi  hotmail.com> writes:
The example you posted is good, but it is more helpful to post the code,
not the pasted result, so that trying you example does not require
manual editing.

I had reported a similar case a year ago; see below. Maybe you should
post it at:

http://biostat.mc.vanderbilt.edu/trac/Hmisc/

#
library(Hmisc)
sessionInfo()

x <- matrix(1:12, nrow=2, dimnames=list(c('a','p'),
  letters[1:6]))
cellTex = matrix(rep("", NROW(x) * NCOL(x)),  nrow=NROW(x))

cellTex[1,1] <- "cellcolor[gray]{0.9}"

# works ok
p = latex(x,file="a.tex",
          cellTexCmds = cellTex) # ok

# Works ok
p = latex(x,file="a.tex",
    cgroup =  c("a","b","c"),n.cgroup=c(2,2,2)
     )

# Fails with a error message "subscript out of bounds"
p = latex(x, file="a.tex",
    cellTexCmds = cellTex,
    cgroup =  c("a","b","c"),n.cgroup=c(2,2,2)
     )