Skip to content
Prev 244202 / 398506 Next

tableGrob and properties of a cell

Hi,

Embarrassingly enough, it was quite straight-forward in the first
versions of grid.table(). You might want to try with version r11 for
example,

source("http://gridextra.googlecode.com/svn-history/r11/trunk/R/tableGrob.r")
library(grid)

 tc  = textConnection("
      carat   VeryLongWordIndeed color clarity depth
 14513  1.35 Ideal     J     VS2  61.4
 28685  0.30  Good     G    VVS1  64.0
 50368  0.75 Ideal     F     SI2  59.2")
 d = read.table(tc,head=T)
 close(tc)
 grid.newpage()
 g = grid.table(d)
 grid.ls(g)
 grid.edit("top-head-fill-5", gp=gpar(fill="red"))
 grid.edit("cells-label-33", label=expression(alpha),gp=gpar(col="orange"))

As I recall, the reason why this is more difficult now (if at all
possible, I have no idea), is that I placed the actual drawing code in
a drawDetails method, so that it gets updated on-the-fly, etc.

I hope this simpler version will suit you, I might re-include it in
the package as an alternative.

HTH,

baptiste
On 7 December 2010 16:53, Alex Bird <sunduck at gmail.com> wrote: