R/02-harmo_process_harmonization.R
as_data_proc_elem.Rd
Validates the input object as a valid data processing elements and coerces it with the appropriate harmonizR::class attribute. This function mainly helps validate input within other functions of the package but could be used to check if an object is valid for use in a function.
as_data_proc_elem(object)
A potential data processing elements to be coerced.
A tibble, identifying a data processing elements.
A data processing element contains the rules and metadata that will be used
to perform harmonization of input datasets in accordance with the DataSchema.
It must be a data-frame or data-frame extension (e.g. a tibble) and it must
contain certain columns which participate to the process, including the
dataschema_variable
, ss-table
,ss_variables
, Mlstr_harmo::rule_category
and
Mlstr_harmo::algorithm
. The mandatory first processing element must be
""id_creation"" in Mlstr_harmo::rule_category
followed by the name of the column
taken as identifier of each dataset to initiate the process of harmonization.
{
# You can use our demonstration files to run examples
as_data_proc_elem(DEMO_files_harmo$`data_processing_elements - final`)
}
#> # A tibble: 52 × 10
#> index dataschema_variable valueType ss_table ss_variables
#> * <dbl> <chr> <chr> <chr> <chr>
#> 1 1 adm_unique_id text dataset_MELBOURNE_1 id
#> 2 1 adm_unique_id text dataset_MELBOURNE_2 id
#> 3 1 adm_unique_id text dataset_PARIS ID
#> 4 1 adm_unique_id text dataset_TOKYO part_id
#> 5 2 adm_study text dataset_MELBOURNE_1 __BLANK__
#> 6 2 adm_study text dataset_MELBOURNE_2 __BLANK__
#> 7 2 adm_study text dataset_PARIS __BLANK__
#> 8 2 adm_study text dataset_TOKYO __BLANK__
#> 9 3 adm_year_dce text dataset_MELBOURNE_1 __BLANK__
#> 10 3 adm_year_dce text dataset_MELBOURNE_2 __BLANK__
#> # ℹ 42 more rows
#> # ℹ 5 more variables: `Mlstr_harmo::rule_category` <chr>,
#> # `Mlstr_harmo::algorithm` <chr>, `Mlstr_harmo::comment` <chr>,
#> # `Mlstr_harmo::status` <chr>, `Mlstr_harmo::status_detail` <chr>