I use R markdown in combination with LaTeX to create dynamic PDF reports. To generate the summarizing tables I use the kableExtra package.
I'd like to change the styling of individual cells.
Example: Consider the R dataframe mtcars[1:10, 1:5]
. Using this would be rendered into some nice table:
kable(mtcars[1:10, 1:5], format="latex", booktabs = T)`
Now I want to change the style of certain cells. Say the 2nd and 8th entry of mpg should be green, the 4th and 5th of disp should be orange and italicized and the last four entries of drat should be red and bold. And the same cells should be like that, no matter which entries are in the cells.
I'm perfectly aware of the documentation and the examples, such as row and column specific colouring. But the documentation for cell_spec deals only with conditional logic depending on the cell values, while I'd like to colour the cells independently.