Checks if an object is a valid Data Processing Elements and returns it with the appropriate Rmonize::class attribute. This function mainly helps validate inputs within other functions of the package but could be used separately to ensure that an object has an appropriate structure.

as_data_proc_elem(object)

Arguments

object

A potential Data Processing Elements object to be coerced.

Value

A data frame with Rmonize::class 'data_proc_elem'.

Details

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).

Examples

{

# Use Rmonize_DEMO to run examples.
library(dplyr)

glimpse(head(as_data_proc_elem(Rmonize_DEMO$`data_processing_elements - final`),3))

}
#> Rows: 3
#> Columns: 10
#> $ index                        <dbl> 1, 2, 3
#> $ dataschema_variable          <chr> "adm_unique_id", "adm_study", "adm_year_d…
#> $ valueType                    <chr> NA, NA, NA
#> $ input_dataset                <chr> "dataset_MELBOURNE", "dataset_MELBOURNE",…
#> $ input_variables              <chr> "id", "__BLANK__", "__BLANK__"
#> $ `Mlstr_harmo::rule_category` <chr> "id_creation", "paste", "paste"
#> $ `Mlstr_harmo::algorithm`     <chr> "id_creation", "\"MELBOURNE\"", "2007"
#> $ `Mlstr_harmo::status`        <chr> "complete", "complete", "complete"
#> $ `Mlstr_harmo::status_detail` <chr> "unknown", "unknown", "unknown"
#> $ `Mlstr_harmo::comment`       <chr> NA, NA, NA