powered by
Binds data frames while properly handling ID columns. Checks for overlapping IDs, combines the data, and fills in missing IDs.
bind_id(..., .id = ".id")
Combined data frame with valid IDs for all rows.
Data frames to bind.
Column name for IDs (default: ".id").
This function:
Checks if IDs overlap between datasets (warns if so)
Binds rows using dplyr::bind_rows()
dplyr::bind_rows()
Fills missing IDs using extend_id()
extend_id()
Use this instead of dplyr::bind_rows() when working with ID columns.
df1 <- add_id(data.frame(x = 1:3)) df2 <- data.frame(x = 4:6) combined <- bind_id(df1, df2)
Run the code above in your browser using DataLab