skimr (version 2.0.2)

focus: Only show a subset of summary statistics after skimming

Description

This function is a variant of dplyr::select() designed to work with skim_df objects. When using focus(), skimr metadata columns are kept, and skimr print methods are still utilized. Otherwise, the signature and behavior is identical to dplyr::select().

Usage

focus(.data, ...)

Arguments

.data

A skim_df object.

...

One or more unquoted expressions separated by commas. You can treat variable names like they are positions, so you can use expressions like x:y to select ranges of variables.

Positive values select variables; negative values drop variables. If the first expression is negative, select() will automatically start with all variables.

Use named arguments, e.g. new_name = old_name, to rename selected variables.

The arguments in ... are automatically quoted and evaluated in a context where column names represent column positions. They also support unquoting and splicing. See vignette("programming") for an introduction to these concepts.

See select helpers for more details and examples about tidyselect helpers such as starts_with(), everything(), ...

Examples

Run this code
# NOT RUN {
# Compare
iris %>%
  skim() %>%
  dplyr::select(n_missing)

iris %>%
  skim() %>%
  focus(n_missing)

# This is equivalent to
iris %>%
  skim() %>%
  dplyr::select(skim_variable, skim_type, n_missing)
# }

Run the code above in your browser using DataLab