[R] Hmisc latex cell background color

Dieter Menne dieter.menne at menne-biomed.de
Thu Dec 15 12:20:30 CET 2005


Dear latex/R-Sweavers,

Using the codel below, I can color text in individual cells for latex
output.
Is there a similar way to get a background shading? My attempts failed
because I did not get the closing brace at the right place with Hmisc/latex.

library(Hmisc)

x <- as.data.frame(diag(rnorm(3),nrow=3))
cellTex <- matrix(rep("", NROW(x) * NCOL(x)), nrow=NROW(x))
cellTex[2,2] <- "\color{red}"
ct <- latex(x, cellTexCmds = cellTex,numeric.dollar=FALSE)
ct$style <- "color"
dvi(ct)


Dieter




More information about the R-help mailing list