简体   繁体   English

R 颜色每隔一行

[英]R Color Every Other Row

Is there a way to create an R table (I want to eventually output it as a PNG).有没有办法创建一个 R 表(我想最终 output 它作为 PNG)。 With every other row colored?每隔一行着色? All of the options I am seeing to color rows are based on the row value and the number of rows and row values will be dynamic so I can't do it that way.我看到的所有对行着色的选项都基于行值,行数和行值将是动态的,所以我不能那样做。

Below is an example of what I want下面是我想要的一个例子在此处输入图像描述

You can use theme_zebra from flextable您可以使用来自theme_zebraflextable

library(flextable)
ftab <- flextable(head(iris))
theme_zebra(ftab)

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM