Create a dictionary
Usage
use_dictionary(data, ...)
# S3 method for list
use_dictionary(data, ...)
# S3 method for data.frame
use_dictionary(data, ..., name = NULL)
Arguments
- data
A data frame or list of data frames.
- ...
Unused but necessary to support for extensions.
- name
Character giving an alternative name for the dataset.
Examples
use_dictionary(mtcars)
#> # A tibble: 11 × 4
#> dataset name type definition
#> <chr> <chr> <chr> <chr>
#> 1 mtcars mpg double NA
#> 2 mtcars cyl double NA
#> 3 mtcars disp double NA
#> 4 mtcars hp double NA
#> 5 mtcars drat double NA
#> 6 mtcars wt double NA
#> 7 mtcars qsec double NA
#> 8 mtcars vs double NA
#> 9 mtcars am double NA
#> 10 mtcars gear double NA
#> 11 mtcars carb double NA
use_dictionary(mtcars, name = "Motor Trend Car Road Tests")
#> # A tibble: 11 × 4
#> dataset name type definition
#> <chr> <chr> <chr> <chr>
#> 1 Motor Trend Car Road Tests mpg double NA
#> 2 Motor Trend Car Road Tests cyl double NA
#> 3 Motor Trend Car Road Tests disp double NA
#> 4 Motor Trend Car Road Tests hp double NA
#> 5 Motor Trend Car Road Tests drat double NA
#> 6 Motor Trend Car Road Tests wt double NA
#> 7 Motor Trend Car Road Tests qsec double NA
#> 8 Motor Trend Car Road Tests vs double NA
#> 9 Motor Trend Car Road Tests am double NA
#> 10 Motor Trend Car Road Tests gear double NA
#> 11 Motor Trend Car Road Tests carb double NA
data <- list(mtcars = mtcars, iris = iris)
use_dictionary(data)
#> # A tibble: 16 × 4
#> dataset name type definition
#> <chr> <chr> <chr> <chr>
#> 1 mtcars mpg double NA
#> 2 mtcars cyl double NA
#> 3 mtcars disp double NA
#> 4 mtcars hp double NA
#> 5 mtcars drat double NA
#> 6 mtcars wt double NA
#> 7 mtcars qsec double NA
#> 8 mtcars vs double NA
#> 9 mtcars am double NA
#> 10 mtcars gear double NA
#> 11 mtcars carb double NA
#> 12 iris Sepal.Length double NA
#> 13 iris Sepal.Width double NA
#> 14 iris Petal.Length double NA
#> 15 iris Petal.Width double NA
#> 16 iris Species integer NA