View source: R/create_dictionary.R
create_dictionary | R Documentation |
Create a data dictionary from any dataset
create_dictionary(dataset, id_var = NULL, file = NULL, var_labels = NULL)
dataset |
The dataset you wish to summarise |
id_var |
A variable/vector of variables that are identifiers (optional) |
file |
The file path to write an Excel spreadsheet (optional) |
var_labels |
A named vector of variable labels (optional) |
Either an Excel spreadsheet or a dataframe
# A simple dictionary printed to console
create_dictionary(esoph)
# You can specify id variable/s
mtcars$id <- 1:nrow(mtcars)
create_dictionary(mtcars, id_var = "id")
# You can also specify labels with a named vector
iris.labels <- c(Sepal.Length = "Sepal length in mm",
Sepal.Width = "Sepal width in mm",
Petal.Length = "Petal length in mm",
Petal.Width = "Petal width in mm",
Species = "Species of iris")
create_dictionary(iris, var_labels = iris.labels)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.