Assesses the content and structure of a dossier object (list of datasets) and generates reports of the results. This function can be used to evaluate data structure, presence of specific fields, coherence across elements, and data dictionary formats.

dossier_evaluate(dossier, taxonomy = NULL, as_data_dict_mlstr = TRUE)

Arguments

dossier

List of data frame, each of them being datasets.

taxonomy

An optional data frame identifying a variable classification schema.

as_data_dict_mlstr

Whether the input data dictionary should be coerced with specific format restrictions for compatibility with other Maelstrom Research software. TRUE by default.

Value

A list of data frames containing assessment reports.

Details

A dossier is a named list containing at least one data frame or more, each of them being datasets. The name of each data frame will be use as the reference name of the dataset.

A taxonomy is a classification schema that can be defined for variable attributes. A taxonomy is usually extracted from an Opal environment, and a taxonomy object is a data frame that must contain at least the columns taxonomy, vocabulary, and terms. Additional details about Opal taxonomies are available online.

The object may be specifically formatted to be compatible with additional Maelstrom Research software, in particular Opal environments.

Examples

{

# use madshapR_DEMO provided by the package
library(dplyr)

###### Example : a dataset list is a dossier by definition.
   
dataset <- as_dataset(
   madshapR_DEMO$`dataset_TOKYO - errors with data`,
   col_id = 'part_id') %>% slice(0)

dossier <- as_dossier(list(dataset = dataset))

glimpse(dossier_evaluate(dossier,as_data_dict_mlstr = FALSE))

}
#> - DOSSIER ASSESSMENT: ----------------------------------------------------
#> - DATA DICTIONARY ASSESSMENT: data_dict --------------
#>     Assess the uniqueness of variable names
#>     Assess the presence of possible duplicated columns
#>     Assess the presence of empty rows in the data dictionary
#>     Assess the presence of empty columns in the data dictionary
#>     Generate report
#> 
#>     The data dictionary contains no error/warning.
#> 
#>   - WARNING MESSAGES (if any): --------------------------------------------
#> 
#> - DATASET ASSESSMENT: dataset (empty dataset) --------------------------
#>     Assess the presence of variable names both in dataset and data dictionary
#>     Assess the presence of possible duplicated variable in the dataset
#>     Assess the presence of duplicated participants in the dataset
#>     Assess the presence of empty rows in the data dictionary
#>     Assess the presence all NA(s) of columns in the data dictionary
#>     Assess the presence of categories not in the data dictionary
#>     Generate report
#> 
#>     The dataset contains no error/warning.
#> 
#>   - WARNING MESSAGES (if any): -------------------------------------------------
#>     
#> List of 1
#>  $ dataset:List of 1
#>   ..$ Data dictionary summary: tibble [9 × 4] (S3: tbl_df/tbl/data.frame)