Analyzes join cardinality without performing the full join. Useful for detecting many-to-many joins that would explode row count.
Details
If the joinspy package is installed, this function delegates to
joinspy::join_spy() for enhanced diagnostics including whitespace
detection, encoding issues, and detailed match analysis.
Examples
x <- data.frame(id = c(1, 1, 2), a = 1:3)
y <- data.frame(id = c(1, 1, 2), b = 4:6)
diagnose_join(x, y, by = "id", use_joinspy = FALSE)