This is a helper function to assist rank_episodes

episode_check(df)

Arguments

df

a data frame with "gap", "initial_rank", and "permi_gap" columns appended from identify_gaps()

Value

a data frame with an "episode" column appended, which ranks episodes of care in time