util_compare_meta_with_study function

Compares study data data types with the ones expected according to the metadata

Compares study data data types with the ones expected according to the metadata

Utility function to compare data type of study data with those defined in metadata

util_compare_meta_with_study( sdf, mdf, label_col, check_convertible = FALSE, threshold_value = 0, return_percentages = FALSE, check_conversion_stable = FALSE )

Arguments

  • sdf: the data.frame of study data

  • mdf: the data.frame of associated static metadata

  • label_col: variable attribute the name of the column in the metadata with labels of variables

  • check_convertible: logical also try, if a conversion to the declared data type would work.

  • threshold_value: numeric from=0 to=100. percentage failing conversions allowed if check_convertible

    is TRUE.

  • return_percentages: logical return the percentage of mismatches.

  • check_conversion_stable: logical do not distinguish convertible from convertible, but with issues

Returns

for return_percentages == FALSE: if check_convertible is FALSE, a binary vector (0, 1) if data type applies, if check_convertible is TRUE`` a vector with the states0, 1, 2, 3: 0 = Mismatch, not convertible 1 = Match 2 = Mismatch, but convertible3 = Mismatch, convertible, but with issues (e.g., loss of decimalplaces) forreturn_percentages == TRUE`: a data frame with percentages of non-matching datatypes according, each column is a variable, the rows follow the vectors returned by util_check_data_type .

See Also

prep_dq_data_type_of

prep_datatype_from_data

Other data_management: util_assign_levlabs(), util_check_data_type(), util_check_group_levels(), util_dichotomize(), util_fix_merge_dups(), util_merge_data_frame_list(), util_rbind(), util_remove_na_records(), util_replace_hard_limit_violations(), util_round_to_decimal_places(), util_study_var2factor(), util_table_of_vct()

  • Maintainer: Stephan Struckmann
  • License: BSD_2_clause + file LICENSE
  • Last published: 2025-03-05

Downloads (last 30 days):