Functions that allow implementers of formatters for custom data types to maintain a consistent style with the default data types.
style_num(x, negative, significant = rep_along(x, TRUE)) style_subtle(x) style_subtle_num(x, negative) style_bold(x) style_na(x) style_neg(x)
x | The character vector to style. |
---|---|
negative, significant | Logical vector the same length as |
style_subtle()
is affected by the pillar.subtle
option.
style_subtle_num()
is affected by the pillar.subtle_num
option, which is
FALSE
by default.
style_bold()
is affected by the pillar.bold
option.
style_neg()
is affected by the pillar.neg
option.
pillar-package for a list of options
#> [1] "\033[31m123\033[39m" "456"#> [1] "\033[31m123\033[39m" "456"style_subtle("text")#> [1] "\033[38;5;246mtext\033[39m"#> [1] "\033[31m0.01\033[39m" "0.02" "\033[31m0.03\033[39m"style_bold("Petal.Width")#> [1] "Petal.Width"style_na("NA")#> [1] "\033[31mNA\033[39m"style_neg("123")#> [1] "\033[31m123\033[39m"