Skip to contents

Just like labelled::generate_dictionary, but less versatile and much faster. Given a dataframe extracts properties of its columns and presents them in a form of a dataframe.

Usage

generate_dict(x)

Arguments

x

a dataframe

Examples

generate_dict(iris)
#> ! Found 5 columns with missing or invalid labels: "Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", and "Species".
#> ℹ Replacing these labels with {.code NA_character_}
#> # A tibble: 5 × 8
#>   variable     label col_type type    levels n_levels value_labels unique_values
#>   <chr>        <chr> <chr>    <chr>   <name>    <int> <named list>         <int>
#> 1 Sepal.Length NA    dbl      double  <NULL>        0 <NULL>                  35
#> 2 Sepal.Width  NA    dbl      double  <NULL>        0 <NULL>                  23
#> 3 Petal.Length NA    dbl      double  <NULL>        0 <NULL>                  43
#> 4 Petal.Width  NA    dbl      double  <NULL>        0 <NULL>                  22
#> 5 Species      NA    fct      integer <chr>         3 <NULL>                   3