I want to produce a table with the gridExtra-Package. This table should have a white background with grid pattern. The following table has white backround but no grid.
y<-iris[1:4,1:5]
hj <- matrix(c(0.90, 0.90, 0.90, 0.90, 0.90), ncol=ncol(y), nrow=nrow(y), byrow=TRUE)
x <- matrix(c( 0.90, 0.90, 0.90, 0.90, 0.90), ncol=ncol(y), nrow=nrow(y), byrow=TRUE)
colours <- matrix("white", nrow(y), ncol(y))
colours[1:nrow(colours), 1] <- "#e9f1e9"
tt1 <- ttheme_default(core=list(fg_params=list(hjust = as.vector(hj),
x = as.vector(x), fontface=c(rep("plain",ncol(y)))), bg_params = list(fill =colours , col=NA)))
tab<-tableGrob(y, rows = NULL, theme = tt1)
grid.newpage()
grid.draw(tab)
In contrast this table has the desired grid but no white backround color.
g <- tableGrob(iris[1:4, 1:3])
grid.newpage()
grid.draw(g)
How to connect this two tables to have both?
