inst/examples/skim_with_labels_and_levels.R

if (requireNamespace("skimr", quietly = TRUE)) {
  # First add some labels to 'mtcars':
  mtcars$car <- rownames(mtcars)
  mtcars$car <- factor(mtcars$car, levels = rownames(mtcars))
  attr(mtcars$car, "label") <- "Name of the car"

  # Then skim the data:
  mtcars |>
    skim_with_labels_and_levels()
}

Try the tidyprompt package in your browser

Any scripts or data that you put into this service are public.

tidyprompt documentation built on April 21, 2026, 9:07 a.m.