Binds data frames while properly handling ID columns. Checks for overlapping IDs, combines the data, and fills in missing IDs.
Details
This function:
Checks if IDs overlap between datasets (warns if so)
Binds rows using
dplyr::bind_rows()Fills missing IDs using
extend_id()
Use this instead of dplyr::bind_rows() when working with ID columns.
Examples
df1 <- add_id(data.frame(x = 1:3))
df2 <- data.frame(x = 4:6)
combined <- bind_id(df1, df2)