Skip to contents

Analyzes a sequence of joins to identify potential issues in the chain. Useful for debugging complex multi-table joins.

Usage

analyze_join_chain(tables, joins)

Arguments

tables

A named list of data frames to join.

joins

A list of join specifications, each with elements:

left

Name of left table

right

Name of right table

by

Join column(s)

Value

A summary of the join chain analysis.

Examples

orders <- data.frame(order_id = 1:3, customer_id = c(1, 2, 2))
customers <- data.frame(customer_id = 1:3, region_id = c(1, 1, 2))
regions <- data.frame(region_id = 1:2, name = c("North", "South"))

analyze_join_chain(
  tables = list(orders = orders, customers = customers, regions = regions),
  joins = list(
    list(left = "orders", right = "customers", by = "customer_id"),
    list(left = "result", right = "regions", by = "region_id")
  )
)