【发布时间】:2016-11-29 22:48:05
【问题描述】:
我有这张表格,我想在 RMD 文件中使用 PANDOC 以 PDF 格式呈现
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
----------------------------
如何使用以下条件格式为“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 = "white"
【问题讨论】:
-
渲染成 HTML 或 PDF?如果是前者,请查看formattable。
-
我不能使用formattable,因为它是PDF
标签: r pdf knitr r-markdown