Requires a dataframe with 4 variables: ID (ideally factor), group (ideally factor), minimum date (int/numeric) and maximum date (int/numeric) and DAT_err as a vector of indices where dating is in wrong order.
switch.dating(DAT_df, DAT_err)a dataframe with 4 variable: ID, group, minimum date (int/num) maximum date (int/num)
a vector containing the indices of the dates which are in wrong order
corrected DAT_mat