pkgdown/mathjax-config.html

Skip to contents

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")

Arguments

...

Data frames to bind.

.id

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

Value

Combined data frame with valid IDs for all rows.

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

df1 <- add_id(data.frame(x = 1:3))
df2 <- data.frame(x = 4:6)
combined <- bind_id(df1, df2)