Conditional font colors in dplyr data_frames (tibbles)?

I recently noticed some conditional formatting of font colors when printing dplyr data_frames (tibbles) to the console, such as red text for negatives and also gray text for some numbers. Some of it is intuitive, but if there's a reference explaining what/when values change color, I would appreciate someone pointing me toward it. I'm not finding anything on Google, and I also don't know if the formatting is being applied by dplyr, tibble, the RStudio IDE, or something else. Thanks!

The new formating that appears in the tivyverse is from by

that provides tools for that. It is then used directly by

to add formatting to data types in columns of tibble.

So it is the tibble :package: which bring color to tibble format, thanks to pillar :package:

I think what is closer of something explaining the format choices is the blog post of tibble 1.4.2 release that explains the addition of options to change the formatting that was introduce in tibble 1.4.1. The options are from pillar 1.1.0

You'll also find some info in the vignette talking about how to extend to new data type

Things move pretty fast and I think you'll find some discussions (present and past) in the issues of tibble repository.

Hope you'll find the information you seek with all that.

2 Likes

Just to add here, the pillar release post that just went up today has some more pillar/tibble disambiguation in it:

3 Likes

Thanks, cderv and mara. This info helps.

2 Likes