{
library(dplyr)
# use madshapR_examples provided by the package
# Data dictionary where the column 'table' is added to
# refer to the associated dataset.
data_dict <-
madshapR_examples$`data_dictionary_example` %>%
lapply(function(x) mutate(x,table = "dataset"))
###### Example 1 search and filter through a column in 'Variables' element
data_dict_f1 <- data_dict_filter(data_dict,filter_var = "name == 'gndr'")
glimpse(data_dict_f1)
###### Example 2 search and filter through a column in 'Categories' element
data_dict_f2 <- data_dict_filter(data_dict,filter_cat = "missing == TRUE")
glimpse(data_dict_f2)
###### Example 3 search and filter through a column across all elements.
# The column must exist in both 'Variables' and 'Categories' and have the
# same meaning
data_dict_f3 <- data_dict_filter(data_dict,filter_all = "table == 'dataset'")
glimpse(data_dict_f3)
}
Run the code above in your browser using DataLab