unable to change the colors of the xtable cells in rmarkdown output to pdf
问题 I have this r markdown code: --- header-includes: - \usepackage{xcolor, colortbl} output: pdf_document: latex_engine: xelatex --- ```{r, results="asis"} library(xtable) library(formattable) # 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",