skim_format {skimr}R Documentation

Change the formatting options for printed skim objects

Description

Formats are dispatched according to the type of value returned by the "skimmer," i.e. summary function. One special formatting "type" exists for the names of the returned vector. The names are used to assign the levels for statistics that have more than one value. Counts and quantiles are common cases.

Usage

skim_format(..., append = TRUE)

skim_format_defaults()

show_formats(which = NULL)

Arguments

...

Named arguments that contain named lists specifying formats to apply.

append

Whether the provided options should be in addition to the defaults already in skim. Default is TRUE.

which

A character vector. One or more of the classes whose formatting options you wish to display.

Details

When a vector is named, the name and the value are combined into a single formatted value. To deal with excessively long names for factor levels, only the first three characters of the name are returned by default. This can be changed by setting a new value for max_char within the .levels type.

Skim uses format() to convert the numeric values returned by the summary functions into displayed values. The default options are a subset of options available in that function.

Value

When setting formatting options, invisible(NULL). When looking up values, a list of option-value pairs.

Functions

Examples

# Format numbers to have more digits
skim_format(numeric = list(digits = 3))

# Show the values for the formats
show_formats

# Show 4-character names in factor levels
skim_format(.levels = list(max_char = 4))

# Reset to the defaults
skim_format_defaults()

[Package skimr version 1.0.2 Index]