| skim_format {skimr} | R Documentation |
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.
skim_format(..., .list = list(), append = TRUE, drop_new = FALSE) skim_format_defaults() show_formats(which = NULL)
... |
Named arguments that contain named lists specifying formats to apply. |
.list |
Instead of individual named entries, you can provided a list
instead. If most |
append |
Whether the provided options should be in addition to the
defaults already in |
drop_new |
Whether types outside of the defaults should be discarded. |
which |
A character vector. One or more of the classes whose formatting options you wish to display. |
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.
When setting formatting options, invisible(NULL). When looking up
values, a list of option-value pairs.
skim_format_defaults: Use the default formatting options within skim
show_formats: Show formatting options currently used, by data type.
For each data type, options are returned as a list of option-value pairs.
# 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)) # Set multiple formats skim_format(numeric = list(digits = 3), .levels = list(max_char = 4)) # Set multiple formats with a .list argument my_formats <- list(numeric = list(digits = 3), .levels = list(max_char = 4)) skim_format(.list = my_formats) # Alternatively, use rlang unquoting semantics skim_format(!!!my_formats) # Reset to the defaults skim_format_defaults()