Skip to contents

This function processes a dataframe to extract and split the composition IDs into separate columns (Label, Index, and LegacyLabel) based on their format.

Usage

normalize_composition_ids(
  user_data,
  in_composition_id_col,
  out_label_col,
  out_index_col,
  out_legacy_col
)

Arguments

user_data

A dataframe containing user data with composition IDs.

in_composition_id_col

A string specifying the column name of the composition IDs in user_data.

out_label_col

A string specifying the name of the new column where the labels will be stored. Default is "Label".

out_index_col

A string specifying the name of the new column where the indexes will be stored. Default is "Index".

out_legacy_col

A string specifying the name of the new column where the legacy status (TRUE or FALSE) will be stored. Default is "LegacyLabel".

Value

A dataframe with new columns (specified by label_col, index_col, and legacy_col) containing the split composition ID components.