Renders the same few rows through each gt_theme_* function in the package
and lays the results out in a grid, one panel per theme, labeled with its name.
Usage
gt_theme_preview(
data,
themes = NULL,
n = 5,
ncol = 3,
density = "compact",
file = NULL,
...
)Arguments
- data
A data frame. A
gttable is also accepted, in which case its underlying data is used.- themes
Character. The theme functions to show, by name. If
NULL, everygt_theme_*in the package is used. Defaults toNULL.- n
Integer. How many rows of
datato show in each panel. Defaults to5.- ncol
Integer. The number of panels across. Defaults to
3.- density
Character. A
densitypassed to every theme, so the panels are comparable. IfNULL, each theme uses its own default. Defaults to"compact".- file
Optional. A path to write a PNG to. If
NULL, the grid is returned for the viewer. Defaults toNULL.- ...
Further arguments passed to
gt_grid(), such asgaporbg.
Details
Each panel is captioned with the theme's name in a neutral style, set outside the table. Using each theme's own heading instead would let a wide display title stretch its panel out of shape.
Themes that take extra arguments, such as style on gt_theme_sofa(), are
shown at their defaults.
See also
gt_grid(), which does the layout.
