Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

new_ornament

Helper to define the contents of a pillar


Description

This function is useful if your data renders differently depending on the available width. In this case, implement the pillar_shaft() method for your class to return a subclass of "pillar_shaft" and have the format() method for this subclass call new_ornament(). See the implementation of pillar_shaft.numeric() and format.pillar_shaft_decimal() for an example.

Usage

new_ornament(x, width = NULL, align = NULL)

Arguments

x

A character vector with formatting, see crayon

width

An optional width of the resulting pillar, computed from x if missing

align

Alignment, one of "left" or "right"

Examples

new_ornament(c("abc", "de"), align = "right")

pillar

Coloured Formatting for Columns

v1.6.0
MIT + file LICENSE
Authors
Kirill Müller [aut, cre], Hadley Wickham [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.