R/03-harmonized_data_evaluate.R
harmonized_dossier_evaluate.Rd
Assesses the content and structure of a harmonized dossier 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.
harmonized_dossier_evaluate(harmonized_dossier)
A list containing the harmonized dataset(s).
A list of data frames containing assessment reports for each harmonized dataset.
A harmonized dossier is a named list containing one or more data frames, which are harmonized datasets. A harmonized dossier is generally the product of applying processing to a dossier object. The name of each harmonized dataset (data frame) is taken from the reference input dataset. A harmonized dossier also contains the DataSchema and Data Processing Elements used in processing as attributes.
A DataSchema is the list of core variables to generate across datasets and
related metadata. A DataSchema object is a list of data frames with elements
named 'Variables' (required) and 'Categories' (if any). The 'Variables'
element must contain at least the name
column, and the 'Categories'
element must contain at least the variable
and name
columns to be usable
in any function. In 'Variables' the name
column must also have unique
entries, and in 'Categories' the combination of variable
and name
columns
must also be unique.
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.
{
# Use Rmonize_examples to run examples.
library(dplyr)
# Perform data processing
harmonized_dossier <- Rmonize_examples$`harmonized_dossier`
eval_harmo <- harmonized_dossier_evaluate(harmonized_dossier)
glimpse(eval_harmo)
}
#> - DATA DICTIONARY ASSESSMENT: data_dict --------------
#> Assess the standard adequacy of naming
#> Assess the uniqueness and presence of variable names
#> Assess the presence of possible duplicated columns
#> Assess the presence of duplicated rows
#> Assess the presence of empty rows in the data dictionary
#> Assess the presence of empty column in the data dictionary
#> Assess the presence of categories not in the data dictionary
#> Assess the `valueType` column in 'Variables'
#> Assess the completion of `label` column in 'Variables'
#> Assess presence and completion of `label` column in 'Categories'
#> Assess the logical values of missing column in Categories
#> Generate report
#>
#> The data dictionary contains no errors/warnings.
#>
#> - WARNING MESSAGES (if any): --------------------------------------------
#>
#> - DATASET ASSESSMENT: pooled_harmonized_dataset --------------------------
#> Assess the standard adequacy of naming
#> 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 possible duplicated participants
#> Assess the presence of unique value columns in dataset
#> Assess the presence of empty rows in the dataset
#> Assess the presence all empty variable in the dataset
#> Assess the Categories comparison in dataset and data dictionary
#> Assess the `valueType` comparison in dataset and data dictionary
#> Generate report
#>
#> - WARNING MESSAGES (if any): -------------------------------------------------
#>
#> List of 2
#> $ Harmo data dictionary summary: tibble [9 × 5] (S3: tbl_df/tbl/data.frame)
#> ..$ Index : chr [1:9] "1" "2" "3" "4" ...
#> ..$ Variable name : chr [1:9] "adm_unique_id" "adm_study_id" "sdc_age_m" "sdc_marital_m" ...
#> ..$ Variable label : chr [1:9] "Participant identifier" "Study ID" "Age of mother at first visit" "Marital status of mother at first visit" ...
#> ..$ Categories in data dictionary: chr [1:9] NA "[1] Study 1\n[2] Study 2\n[3] Study 3\n[4] Study 4\n[5] Study 5" NA "[0] Single (never married) or not living with partner\n[1] Married or living with partner\n[2] Divorced or sepa"| __truncated__ ...
#> ..$ Non-valid categories : chr [1:9] NA NA NA NA ...
#> $ Harmo dataset assessment : tibble [1,156 × 5] (S3: tbl_df/tbl/data.frame)
#> ..$ Index : chr [1:1156] "1" "1" "1" "1" ...
#> ..$ Variable name : chr [1:1156] "adm_unique_id" "adm_unique_id" "adm_unique_id" "adm_unique_id" ...
#> ..$ Harmo dataset assessment: chr [1:1156] "[INFO] - Duplicated rows (excluding identifier)." "[INFO] - Duplicated rows (excluding identifier)." "[INFO] - Duplicated rows (excluding identifier)." "[INFO] - Duplicated rows (excluding identifier)." ...
#> ..$ Value : chr [1:1156] "PID2444 ; PID6070" "PID5531 ; PID7645" "PID2866 ; PID1861 ; PID8315" "PID3435 ; PID3700" ...
#> ..$ Suggested valueType : chr [1:1156] NA NA NA NA ...