style_subtle: Styling helpers

Description Usage Arguments Details See Also Examples

Description

Functions that allow implementers of formatters for custom data types to maintain a consistent style with the default data types.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

Arguments

x

The character vector to style.

negative, significant

Logical vector the same length as x that indicate if the values are negative and significant, respectively

Details

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.

See Also

pillar-package for a list of options

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
style_num(
  c("123", "456"),
  negative = c(TRUE, FALSE)
)
style_num(
  c("123", "456"),
  negative = c(TRUE, FALSE),
  significant = c(FALSE, FALSE)
)
style_subtle("text")
style_subtle_num(0.01 * 1:3, c(TRUE, FALSE, TRUE))
style_bold("Petal.Width")
style_na("NA")
style_neg("123")

hadley/pillar documentation built on Oct. 20, 2018, 8:12 a.m.