paint: Paint a rectangle in the data.frame family

View source: R/paint.R

paintR Documentation

Paint a rectangle in the data.frame family

Description

paint is an alternative print method of objects that are of class data.frame. It has been described as a "pretty pillar::glimpse()", since it also favours printing columns running horizontally.

Usage

paint(df, ...)

Arguments

df

the dataframe to paint

...

further arguments to class specific paint methods

Details

paint tries to be low noise by using colour instead of markup characters. It also highlights important values like NA, NULL, NaN, and Inf.

Each supported sub-class of data.frame has a custom meta data header, designed to show useful information for wrangling.

The appearance of the output can be customised with options:

  • paint_palette the palette to paint row colours with, defaults to rainbow_6(), 6 standard ANSI colours that are supported in most terminals.

  • paint_n_rows the number of rows to print for each column. Defaults to the number of colours in the paint_palette, but can be set higher for repeating sequences.

  • paint_max_width the maximum width of the output. 60 is the default. {paint} does not resize based on terminal width by design.

  • paint_align_row_head = c("left", "center", "right"). How to align the column title and type. Defaults to "left".

  • paint_dark_mode darken the paint_palette using crayon::blurred - not supported in all terminals.

Value

df invisibly. Text outputed printed to console.

See Also

unpaint() for calling the default print method on a dataframe

Examples

paint(mtcars)

MilesMcBain/paint documentation built on Dec. 5, 2023, 9:11 a.m.