I have a question regarding tableGrob/grid.table from the gridExtra package. Using the regular parameter settings, it is straightforward to colour alternate rows. However, I was hoping that it might be feasible to get a bit more control over the colouring of the rows.
For example, is it possible to colour every third row in a different colour? I suspect the grid.edit function is one way to approach this, judging by the example in this link: http://code.google.com/p/gridextra/wiki/tableGrob but I can't figure out how to apply that to my question.
I believe the person who posted this question had the same in mind. Table with rows of different colors with tableGrob
I am currently stuck with R 2.13 due to compatibility issues, so if there are any suggestions which don't involve later versions that would be ideal.
Example code:
library(gridExtra)
grid.table(mtcars[1:10, ],
gpar.coretext = gpar(fontsize = 10),
gpar.corefill = gpar(fill = "lightblue", alpha=0.5, col = NA),
h.even.alpha = 0.5
)
See Question&Answers more detail:os