Skip to main content
100%

rolling_join

✓ Published0🌍 Public
JJustinCally
Last edited Jan 16, 2020
Created on Jan 16, 2020

This example demonstrates a self-referencing rolling join that repeatedly chains a dataset to itself through linked ID columns until no further matches remain. The `rolling_join` function takes an initial table and a lookup table, then iteratively joins the current result to the lookup using `dplyr::left_join`, renaming the target columns at each step to create a new hierarchy level. The loop continues while new matches are found, producing a flattened table that traces the full ancestry or downstream relationships from the starting IDs. The code uses base R for column renaming and the `dplyr` package for the join operations.

AI-generated description

Similar vizzes