Skip to content

condformat

0.11.0Package record

Conditional Formatting in Data Frames

0packages depend
9Kdownloads / year
87.8%test coverage
8/13flavors OK

Overview

About

Apply and visualize conditional formatting to data frames in R. It renders a data frame with cells formatted according to criteria defined by rules, using a tidy evaluation syntax. The table is printed either opening a web browser or within the 'RStudio' viewer if available. The conditional formatting rules allow to highlight cells matching a condition or add a gradient background to a given column. This package supports both 'HTML' and 'LaTeX' outputs in 'knitr' reports, and exporting to an 'xlsx' file.

Changes in 0.11.0

Breaking changes

  • Drop the magrittr dependency and the %>% pipe operator it re-exported (part of #43). condformat now requires R >= 4.1 and its own examples, tests and vignette use the native base R pipe (|>) instead. If your code relied on library(condformat) making %>% available, either library(magrittr) yourself or switch to |>.

Dependencies

  • Move gridExtra, gtable, openxlsx and rmarkdown from Imports to Suggests. These are each only needed for one specific, optional output path: openxlsx for condformat2excel()/condformat2excelsheet(), gridExtra/gtable for condformat2grob()/theme_grob(), and rmarkdown for LaTeX/PDF output via knit_print(). If you only ever use condformat's default HTML/RStudio-viewer printing, you no longer need to install any of these. Calling one of the functions above without the corresponding package installed now stops with a clear install.packages(...) hint instead of a generic "there is no package called" error, or (for rmarkdown) failing deep inside knit_print().
Show all changes in 0.11.0Hide the rest of the changes in 0.11.0
  • Bump the minimum required version of all versioned dependencies to the release that was current about a year ago, rather than today's exact latest release, so users aren't forced onto a brand new patch just to install condformat (part of #43): dplyr (>= 1.1.4), gtable (>= 0.3.6), htmlTable (>= 2.4.3), htmltools (>= 0.5.8.1), knitr (>= 1.50), openxlsx (>= 4.2.8), rmarkdown (>= 2.29), rlang (>= 1.1.6), scales (>= 1.4.0), tibble (>= 3.3.0), tidyselect (>= 1.2.1), shiny (>= 1.11.1), testthat (>= 3.2.3) and vdiffr (>= 1.0.8). gridExtra's floor (>= 2.3) is unchanged, as that release is still the latest on CRAN as of a year ago.

New features

  • rule_fill_bar() is now supported in Excel output, rendered using Excel's own native data bar conditional formatting (coloured with low) instead of being dropped with an "unsupported rule" warning. This only applies when expression is left at its default (or explicitly .col), since Excel data bars always reflect a cell's own displayed value against a range and can't replicate an arbitrary custom expression; in that case the data bar itself is skipped (with a warning) but the flat background/na.value cell colours are still applied, as before.
  • Export condformat2excelsheet(), which writes a condformat table into a worksheet of an openxlsx workbook you're already building, without creating or saving the workbook itself (closes #25). Its docs show how to combine condformat's own cell styling with your own openxlsx::addStyle() calls (e.g. a number format) via stack = TRUE, since addStyle() replaces existing styles by default.
  • Add a .col pronoun usable in the expression argument of rule_fill_discrete(), rule_fill_gradient(), rule_fill_gradient2(), rule_fill_bar(), rule_text_bold(), rule_text_color() and rule_css(). When columns selects more than one column, .col is bound to each column's own values in turn, so a single rule call can format several columns based on each one's own condition (closes #19): rule_fill_discrete(c(Sepal.Length, Sepal.Width), .col > 3) is now equivalent to chaining the rule once per column. expression now also defaults to .col when omitted, replacing the previous behaviour of silently using only the first selected column (with a warning) when no expression was given for a multi-column selection.

Fixes

  • Fix condformat2excel()/condformat2excelsheet() silently discarding any pre-existing cell formatting on every export — including a Date column's automatic format from openxlsx::writeData() — even for cells with no condformat rule applied to them. condformat2excelsheet()'s own styling now uses stack = TRUE internally, so it merges with, rather than replaces, formatting that was already there (related to #25).
  • Fix lockcells = TRUE being ignored (or worse, unlocking cells) for LaTeX and grob/gtable output in rule_fill_discrete(), rule_fill_gradient(), rule_fill_gradient2(), rule_text_bold() and rule_text_color(). HTML and Excel output were not affected.
  • Fix theme_htmlTable() discarding arguments accumulated from earlier theme_htmlTable() calls in the same pipeline, due to a %in% check against list values instead of list names.
  • Fix rule_fill_bar()'s na.value never being applied to background-color in HTML output: the CSS mask used to gate that assignment already excluded NA cells, so the assignment was dead code.
  • Fix rule_fill_bar() erroring in grob/gtable output when a value rescaled to exactly 0% of the bar width (colorRampPalette() can't return zero colours); such cells now render with just the background colour.
  • Fix rule_fill_bar()'s lockcells = TRUE not protecting NA cells from later CSS/HTML rules, and not protecting any cell (NA or not) from later grob/gtable rules: the grob/gtable renderer painted every targeted cell unconditionally and never checked incoming lock state at all.
  • Fix rule_text_bold(), rule_text_color() and rule_css() erroring when expression evaluates to a single (scalar) value on a table with more than one row, unlike rule_fill_discrete(), rule_fill_gradient(), rule_fill_gradient2() and rule_fill_bar(), which already recycled such values to every row.

Other

  • Fix the bundled shiny example (inst/shinyexample/): requireNamespace() now passes quietly = TRUE, so it no longer prints a package-startup message every time the optional colourpicker dependency isn't installed. Also modernised the legacy shinyUI()/shinyServer() wrappers to the current ui <- ... / server <- function(input, output) {...} style.

From NEWS.md in the release

Install

Health

CRAN checks
5NOTE8OK
Check messages
NOTER code for possible problemsr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64
Found calls to structure() using deprecated special names:
  condformat/tests/testthat/test-render-html.R (.Dim: 2, .Dimnames: 2)
'.Dim' should be changed to 'dim'.
'.Dimnames' should be changed to 'dimnames'.

CRAN check page ↗

Slowest check: 2.0 min · r-oldrel-windows-x86_64
Status changes
  • NOTE8 OK, 5 NOTENow
  • NOTE11 OK, 2 NOTE2026-07-16
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.11.0
READMEYes · 241 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.11.0Citation fileNoWebsiteYes · pkgdown
Help pages
27
Examples that run
95%19 run in a plain check · 1 never run
Exported functions with examples
76%
Documented parameters
100%
Return-value docs
56%
Help pages citing references
0%

Downloads

9K
CRAN downloads in the past year
Rank #4,862 · ~25/day · ~749/mo
Daily download trend is not available in this view yet.
51630 days
1.7K90 days
9K1 year
Compare downloads with other packages →
Also on95 r2u6 autocran1.3K conda_forge

Repository

25Stars
6Forks
0Open issues
0Open PRs
10Releases
371Commits
3Commit identities
r-packagevisualisationtableformattinghtmllatex
371 commits · Last activity 2026-07-10 · Default branch at 0.11.0.9000, ahead of CRAN 0.11.0 (checked 2026-10-25)
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
2
Median days to close, 50 most recently updated closed PRs
0
PracticesBeta

11 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/zeehio/condformat on 2026-10-25.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (1)

The repository owner accepts GitHub Sponsors

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-07-10 · The repository has a site deploy workflow

pkgdown site last built 2026-07-10

Coverage (1)
Coverage reporting
Show all practicesHide 2 practices
CRAN release process (2)
cran-comments.mdrevdep/
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-07-07
    Pull request it wrote: opened by a project member
    Commits: 37 by its own account
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
16 external dependencies (excludes base and recommended)

Installing condformat adds 48 packages (25 with compiled code, 37 MB of source tarballs). Heaviest: stringi 11 MB, bslib 5.6 MB, sass 2.9 MB.

Depends (1)
R >= 4.1
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Copyright holder, Maintainer · added in 0.10.0

Maintainer since 0.2.0 (2016)

Listed in earlier versions (1)
no longer listed · 0.2.0 to 0.9.0
Releases (10)

Pick two releases to compare their code metrics.

  • 0.11.0Latest
    record
    2026-07-09 · current release · diff ↗ ·
    removed 1 export
    %>%
    added 1 export
    condformat2excelsheet
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 0.10.1
    record
    2023-10-08 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 0.10.0
    record
    2022-11-26 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • 0.9.0
    record
    2020-05-14 · diff ↗ ·
    removed 8 exports
    rule_fill_discrete_, rule_fill_gradient2_, rule_fill_gradient2_old, rule_fill_gradient_, rule_fill_gradient_old, show_columns_, show_rows_, uq
  • R
    R 4.0.0 released · 2020-04-24
  • R
    R 3.6.0 released · 2019-04-26
  • 0.8.0
    record
    2018-10-29 · diff ↗ ·
    added 11 exports
    cf_field_to_css, cf_field_to_gtable, cf_field_to_latex, condformat2grob, rule_fill_bar, rule_text_bold, rule_text_color, theme_caption, theme_grob, theme_htmlWidget, theme_kable
  • R
    R 3.5.0 released · 2018-04-23
  • 0.7.0
    record
    2017-10-19 · diff ↗ ·
    added 4 exports
    %>%, rule_css, rule_fill_gradient2_old, rule_fill_gradient_old
  • 0.6.0
    record
    2017-05-18 · diff ↗ ·
    added 1 export
    condformat_example
Show 6 earlier eventsHide 6 earlier events
  • R
    R 3.4.0 released · 2017-04-21
  • 0.5.0
    record
    2017-01-23 · diff ↗ ·
    added 4 exports
    condformat2widget, condformatOutput, renderCondformat, uq
  • 0.4.0
    record
    2016-07-25 · diff ↗ ·
    added 2 exports
    condformat2excel, condformat2latex
  • R
    R 3.3.0 released · 2016-05-03
  • 0.2.0
    record
    2016-03-07
  • R
    R 3.2.0 released · 2015-04-16

Package metadata

First published
2016-03-07
Total releases
10 / 10 yrs
License
BSD_3_clause + file LICENSE OSI
Minimum R
≥ 4.1
Download size
128 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("condformat")
Oller Moreno, S. (2026). condformat: Conditional Formatting in Data Frames (Version 0.11.0) [Computer software]. https://doi.org/10.32614/CRAN.package.condformat

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for condformat version 0.11.0 [Data set]. HJJB, LLC. Data release v2026-10-26. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy