how do you color the cell in rmarkdown pdf output
问题 I cannot get cellcolor to work in rmarkdown: --- header-includes: - \usepackage{colortbl} - \usepackage{color} output: pdf_document --- ```{r, results="asis"} library(xtable) # Your data tab = data.frame(category = c("A","B","C"), groupA = c(.2,.3,.5), groupB= c(.6,.7,.9)) # Function to cut your data, and assign colour to each range f <- function(x) cut(x, c(0, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, Inf), labels=c("green", "red", "blue", "orange", "yellow", "purple", "brown", "white"), include