Learn R Programming

madshapR (version 2.0.0)

data_dict_list_nest: Bind listed data dictionaries

Description

Binds a list of data dictionaries into one data dictionary. This is a wrapper function analogous to dplyr::bind_rows().

Usage

data_dict_list_nest(data_dict_list, name_group = NULL)

Value

A list of data frame(s) identifying a workable data dictionary structure.

Arguments

data_dict_list

A list of data frame(s) representing metadata to be transformed.

name_group

A character string of one column in the dataset that can be taken as a grouping column.

Details

A data dictionary contains the list of variables in a dataset and metadata about the variables and can be associated with a dataset. A data dictionary object is a list of data frame(s) named 'Variables' (required) and 'Categories' (if any). To be usable in any function, the data frame 'Variables' must contain at least the name column, with all unique and non-missing entries, and the data frame 'Categories' must contain at least the variable and name columns, with unique combination of variable and name.

See Also

Examples

Run this code
{

library(dplyr)

# use madshapR_examples provided by the package
# Create a list of data dictionaries where the column 'table' is added to 
# refer to the associated dataset. The object created is not a 
# data dictionary per say, but can be used as a structure which can be 
# shaped into a data dictionary.

data_dict_list <- list(
  data_dict_1 = madshapR_examples$`data_dictionary_example` ,
  data_dict_2 = madshapR_examples$`data_dictionary_example - collapsed`)

data_dict_ns <-
  data_dict_list_nest(data_dict_list, name_group = "table") %>%
  data_dict_group_by(col = "table")

glimpse(data_dict_ns)

}

Run the code above in your browser using DataLab