-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NA styling #70
Comments
Please choose your preference, screenshot taken in RStudio: Code to create the matrix: bg <- c("bgBlack", "bgBlue", "bgCyan", "bgGreen", "bgMagenta", "bgRed", "bgWhite", "bgYellow")
fg <- tolower(gsub("^bg", "", bg))
library(tidyverse)
library(crayon)
combs <- tidyr::crossing(bg, fg)
find_fun <- function(name) {
get(name, asNamespace("crayon"), mode = "function")
}
combs %>%
rowwise() %>%
mutate(na = find_fun(fg)(find_fun(bg)("NA"))) %>%
ungroup() %>%
group_by(bg) %>%
summarize(na = paste(na, collapse = " ")) %>%
ungroup() %>%
summarize(val = paste0(format(bg), " ", na, collapse = "\n")) %>%
pull() %>%
cat() |
Let's try bgRed + white |
Actually, let's just try "red" and leave the background colour alone. I think that should be sufficient contrast in most styling configs. |
I do wonder why |
- `NA` values are now shown in plain red, without changing the background color (#70). - New options to control the output, with defaults that match the current behavior unless stated otherwise: - `pillar.sigfig` to control the number of significant digits, for highlighting and truncation (#72), - `pillar.subtle` to specify if insignificant digits should be printed in gray (#72), - `pillar.neg` to specify if negative digits should be printed in red, - `pillar.bold` to specify if column headers should be printed in bold (default: `FALSE`, #76), - `pillar.min_title_chars` to specify the minimum number of characters to display for each column name (default: 15 characters, #75). - Shortened abbreviations for types: complex: cplx -> cpl, function: fun -> fn, factor: fctr -> fct (#71). - Date columns now show sub-seconds if the `digits.secs` option is set (#74). - Work around failing CRAN tests on Windows.
- `NA` values are now shown in plain red, without changing the background color (#70). - New options to control the output, with defaults that match the current behavior unless stated otherwise: - `pillar.sigfig` to control the number of significant digits, for highlighting and truncation (#72), - `pillar.subtle` to specify if insignificant digits should be printed in gray (#72), - `pillar.neg` to specify if negative digits should be printed in red, - `pillar.bold` to specify if column headers should be printed in bold (default: `FALSE`, #76), - `pillar.min_title_chars` to specify the minimum number of characters to display for each column name (default: 15 characters, #75). - Shortened abbreviations for types: complex: cplx -> cpl, function: fun -> fn, factor: fctr -> fct (#71). - Date columns now show sub-seconds if the `digits.secs` option is set (#74). - Very wide tibbles now print faster (#85).
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
I'm not in love with the current treatment. Did we try yellow or red foreground colour?
The text was updated successfully, but these errors were encountered: