sweave, xtable, longtable and alternating row colors…problems with `add.to.row`
This existing question covers a way to alternate row colors in a latex table by post-processing the output from print.xtable() , but I think it's possible to achieve the same thing by using the add.to.row argument of print.xtable() as described on stats.stackexchange , avoiding the need for post-processing, which is nice with Sweave. That answer deals with coloring the background of one specific row, but I think it can be extended to coloring all the odd rows. The problem I'm running into has to do with the add.to.row argument, making the length of list pos equal the length of character vector