Learn R Programming

keyed (version 0.1.3)

bind_id: Bind data frames with ID handling

Description

Binds data frames while properly handling ID columns. Checks for overlapping IDs, combines the data, and fills in missing IDs.

Usage

bind_id(..., .id = ".id")

Value

Combined data frame with valid IDs for all rows.

Arguments

...

Data frames to bind.

.id

Column name for IDs (default: ".id").

Details

This function:

  1. Checks if IDs overlap between datasets (warns if so)

  2. Binds rows using dplyr::bind_rows()

  3. Fills missing IDs using extend_id()

Use this instead of dplyr::bind_rows() when working with ID columns.

Examples

Run this code
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