grid.table(head(iris), h.even.alpha=1, h.odd.alpha=1, v.even.alpha=0.5, v.odd.alpha=1)
grid.newpage()
grid.draw(tableGrob(head(iris, 10), name="test"))
e = expression(alpha,"testing very large width", hat(beta), integral(f(x)*dx, a, b), "abc")
grid.edit("test", cols=e, show.rownames=FALSE, rows=NULL,
gpar.corefill = gpar(fill="white", col=NA),
grep=TRUE, global=TRUE)
grid.newpage()
grid.draw(tableGrob(head(iris, 10),
show.csep=TRUE, show.rsep=TRUE, show.box=TRUE, separator="grey", name="test"))
grid.edit("test",gp=gpar(fontsize=8, lwd=2), equal.width=TRUE, grep=TRUE, global=TRUE)
# visualize themes
lg <- lapply(c("theme.blank", "theme.default", "theme.white", "theme.vertical", "theme.list", "theme.black"),
function(x) tableGrob(head(iris[, 1:3]), theme=get(x)()))
grid.newpage()
do.call(grid.arrange, lg)
## timing: a bit slow due to repeated on-the-fly calculations
pdf("test2.pdf", height=50)
print(system.time( grid.table(iris)) ) # about 12s here
dev.off()
Run the code above in your browser using DataLab