R/02-harmo_process_harmonization.R
pooled_harmonized_dataset_create.Rd
Generates a pooled harmonized dataset from a harmonized dossier. The function
has two arguments that can optionally be declared by the user
(unique_col_dataset
and unique_col_id
). unique_col_dataset
refers to
the columns which contains name of each harmonized dataset. unique_col_id
refers to the column in harmonized datasets which identifies unique
combinations of observation/dataset. These two columns are added to ensure
that there is always a unique entity identifier when datasets are pooled.
pooled_harmonized_dataset_create(
harmonized_dossier,
harmonized_col_dataset =
attributes(harmonized_dossier)$`Rmonize::harmonized_col_dataset`,
harmonized_col_id = attributes(harmonized_dossier)$`Rmonize::harmonized_col_id`,
add_col_dataset = FALSE,
dataschema = attributes(harmonized_dossier)$`Rmonize::DataSchema`,
data_proc_elem = attributes(harmonized_dossier)$`Rmonize::Data Processing Elements`
)
A list containing the harmonized dataset(s).
A character string identifying the column to use for dataset names.
A character string identifying the name of the column present in every dataset to use as a dataset identifier.
Whether to add an extra column to each harmonized dataset. The resulting data frame will have an additional column and its data dictionary will be updated accordingly adding categories for this variable if necessary. FALSE by default.
A DataSchema object.
A Data Processing Elements object.
A data frame containing the pooled 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.
The Data Processing Elements specifies the algorithms used to process input
variables into harmonized variables in the DataSchema format. It is also
contains metadata used to generate documentation of the processing.
A Data Processing Elements object is a data frame with specific columns
used in data processing: dataschema_variable
, input_dataset
,
input_variables
, Mlstr_harmo::rule_category
and Mlstr_harmo::algorithm
.
To initiate processing, the first entry must be the creation of a harmonized
primary identifier variable (e.g., participant unique ID).