new_pillar_shaft() constructor creates objects of the
This is a virtual or abstract class, you must specify the
By convention, this should be a string that starts with
vignette("extending", package = "tibble") for usage examples.
This method accepts a vector of arbitrary length and is expected to return an S3 object with the following properties:
It has an attribute
It can have an attribute
"min_width", if missing,
"width" is used
It must implement a method
format(x, width, ...) that can be called with any value between
This method must return an object that inherits from
character and has attributes
"align" (with supported values
new_pillar_shaft() returns such an object, and also correctly formats
In many cases, the implementation of
pillar_shaft.your_class_name() will format the data as a character vector (using color for emphasis) and simply call
pillar:::pillar_shaft.numeric for a code that allows changing the display depending on the available width.
new_pillar_shaft_simple() provides an implementation of the
class suitable for output that has a fixed formatting, which will be
truncated with a continuation character (ellipsis or
~) if it doesn't fit
the available width.
By default, the required width is computed from the natural width of the
new_pillar_shaft(x, ..., width = NULL, min_width = width, class = NULL, subclass = NULL) new_pillar_shaft_simple(formatted, ..., width = NULL, align = "left", min_width = NULL, na_indent = 0L)
The maximum column width.
The minimum allowed column width,
The name of the subclass.
Deprecated, pass the
An object coercible to character.
Alignment of the column.
formatted argument may also contain ANSI escapes to change color
or other attributes of the text, see crayon.