I\'m pretty much a beginner at programmatically formatting R output, but I\'ve got a basic understanding of knitr, xtable, Markdown, and Pandoc\'s
I've played around a good amount with formatting RMarkdown documents.
Since RMarkdown gets converted to LaTeX before the end PDF is generated, you can pass arguments that would work in LaTeX to RMarkdown. So, adding
header-includes:
- \usepackage{xcolor}
in the heading of the RMarkdown document, and then adding something like
for(i in seq(1, nrow(yourDataframe), by = 2)){
yourDataframe[i, ] <- paste0("\\color{purple}", yourDataframe[i, ])
row.names(yourDataframe)[i] <- paste0("\\color{purple}", row.names(yourDataframe)[i])
}
will get you purple (or whatever color specified and allowed in the xcolor LaTeX package) entries in every other row of your table. Just another way to emphasize entries that isn't the base bold or italics given.
This isn't row highlighting, but could give you further customizable options.
*Tested with the pander package.
**You'll need to convert any factor columns to character columns for this method.