我在.RMD文件中有这个表,我想用条件格式在PDF中呈现.目前我正在使用pandoc.如何用xtable完成?
table = data.frame(category = c("A","B","C"), groupA = c(.2,.3,.5), groupB= c(.6,.7,.9))
table
pandoc.table(table,split.table = Inf,keep.line.breaks = TRUE)
----------------------------
category groupA groupB
---------- -------- --------
A 0.2 0.6
B 0.3 0.7
C 0.5 0.9
----------------------------
Run Code Online (Sandbox Code Playgroud)
如何使用条件格式为"groupA"和"groupB"列的单元格着色,如:
>0 and <= .2 = "green"
>.2 and <= .3 = "red"
>.3 and <= .4 = "blue"
>.4 and <= .5 = "orange"
>.5 and <= .6 = "yellow"
>.6 and <= .7 = "black"
>.7 and <= .8 = "brown"
>.8 …Run Code Online (Sandbox Code Playgroud)