Bump dev version
Sergio Oller 2023-10-08
condformat renders a data frame in which cells in columns are formatted according to several rules or criteria.
Checkout the code and browse it at https://github.com/zeehio/condformat.
If you want to use the PDF output you will need the xcolor LaTeX package. Either use the full texlive distribution, or install latex-xcolor on Debian and derivatives.
xcolor
latex-xcolor
From CRAN:
install.packages("condformat")
To install the latest development version:
remotes::install_github("zeehio/condformat")
data(iris) library(condformat) condformat(iris[c(1:5,70:75, 120:125),]) %>% rule_fill_discrete(Species) %>% rule_fill_discrete(c(Sepal.Width, Sepal.Length), expression = Sepal.Width > Sepal.Length - 2.25, colours = c("TRUE" = "#7D00FF")) %>% rule_fill_gradient2(Petal.Length) %>% rule_text_bold(c(Sepal.Length, Species), Species == "versicolor") %>% rule_text_color(Sepal.Length, expression = ifelse(Species == "setosa", "yellow", "")) %>% rule_fill_bar(Petal.Width, limits = c(0, NA)) %>% theme_grob(rows = NULL) %>% condformat2grob()
This example covers most of the condformat rules.
rule_fill_discrete
rule_fill_gradient
rule_fill_gradient2
rule_text_color
rule_text_bold
rule_fill_bar
rule_css
用于在R语言中根据条件格式化数据框的包,支持在表格中突出显示满足特定条件的单元格
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802047560号
Introduction to condformat
Sergio Oller 2023-10-08
condformat renders a data frame in which cells in columns are formatted according to several rules or criteria.
Browse source code
Checkout the code and browse it at https://github.com/zeehio/condformat.
How to install condformat:
Dependencies
If you want to use the PDF output you will need the
xcolorLaTeX package. Either use the full texlive distribution, or installlatex-xcoloron Debian and derivatives.Package installation
From CRAN:
To install the latest development version:
Example
This example covers most of the condformat rules.
Rules and output engine support
rule_fill_discreterule_fill_gradientrule_fill_gradient2rule_text_colorrule_text_boldrule_fill_barrule_css