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

new_pillar_component

Components of a pillar


Description

new_pillar_component() constructs an object of class "pillar_component".

pillar_component() is a convenience helper that wraps the input in a list and extracts width and minimum width.

Usage

new_pillar_component(x, ..., width, min_width = NULL)

pillar_component(x)

Arguments

x

A bare list (for new_pillar_component()), or an object with attributes "width" and "min_width" attributes (for pillar_component()).

...

These dots are for future extensions and must be empty.

width, min_width

Width and minimum width for the new component. If min_width is NULL, it is assumed to match width.

Details

Objects of class "pillar" are internally a named lists of their components. The default components are title (may be missing), type, and data. Each component is a "pillar_component".

This class captures contents that can be fitted in a rectangle. Each component consists of one or multiple cells that are aligned horizontally (with one space in between) when printed. Each cell has a maximum (i.e., desired) width and may have a minimum width if the contents are compressible. The component object stores the width of the cells as an attribute.

Examples

new_pillar_component(list(letters[1:3]), width = 1)
pillar_component(new_pillar_title("letters"))
pillar_component(new_pillar_type(letters))
pillar_component(pillar_shaft(letters[1:3]))

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.