info_paletteer {gt}R Documentation

View a table with info on color palettes

Description

While data_color() allows us to flexibly color data cells in our gt table, the harder part of this process is discovering and choosing color palettes that are suitable for the table output. We can make this process much easier in two ways: (1) by using the paletteer package, which makes a wide range of palettes from various R packages readily available, and (2) calling info_paletteer() to give us an information table that serves as a quick reference for all of the discrete color palettes available in paletteer.

Usage

info_paletteer(color_pkgs = NULL)

Arguments

color_pkgs

Filter to specific color packages

⁠vector<character>⁠ // default: NULL (optional)

A vector of color packages that determines which sets of palettes should be displayed in the information table. If this is NULL (the default) then all of the discrete palettes from all of the color packages represented in paletteer will be displayed.

Details

The palettes displayed are organized by package and by palette name. These values are required when obtaining a palette (as a vector of hexadecimal colors), from paletteer::paletteer_d(). Once we are familiar with the names of the color palette packages (e.g., RColorBrewer, ggthemes, wesanderson), we can narrow down the content of this information table by supplying a vector of such package names to color_pkgs.

Colors from the following color packages (all supported by paletteer) are shown by default with info_paletteer():

Value

An object of class gt_tbl.

Examples

Get a table of info on just the "ggthemes" color palette (easily accessible from the paletteer package).

info_paletteer(color_pkgs = "ggthemes")
This image of a table was generated from the first code example in the `info_paletteer()` help file.

Function ID

11-5

Function Introduced

v0.2.0.5 (March 31, 2020)

See Also

Other information functions: info_currencies(), info_date_style(), info_flags(), info_google_fonts(), info_icons(), info_locales(), info_time_style(), info_unit_conversions()


[Package gt version 0.11.0 Index]