You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When performing non-equi joins (<, >, <=, >=), it's important to understand how column names are assigned in the result.
575
575
576
-
- The left operand (x column) determines the column name in the result.
577
-
- The right operand (i column) contributes values but does not retain its original name.
578
-
- By default, data.table does not retain the i column used in the join condition unless explicitly requested.
576
+
- The left operand (`x` column) determines the column name in the result.
577
+
- The right operand (`i` column) contributes values but does not retain its original name.
578
+
- By default, `data.table` does not retain the `i` column used in the join condition unless explicitly requested.
579
579
580
-
In non-equi joins, the left side of the operator (e.g., A in A >= B) must be a column from x,
581
-
and the right side (e.g., B) must be a column from i. Non-equi join does not support arbitrary expressions. For example, on = .(x_col >= i_col) is valid, but on = .(x_col >= i_col + 1) is not.
580
+
In non-equi joins, the left side of the operator (e.g., `A` in `A >= B`) must be a column from `x`,
581
+
and the right side (e.g., `B`) must be a column from `i`. Non-equi join does not support arbitrary expressions. For example, `on = .(x_col >= i_col)` is valid, but `on = .(x_col >= i_col + 1)` is not.
582
582
583
583
Arbitrary comparisons can be accomplished by create temporary columns first. For example:
584
584
@@ -590,7 +590,7 @@ x[i, on = .(A >= B)]
590
590
In data.table, when using a non-equi join condition (>=, <, etc.), the column from x is retained in the result, while the column from i is not retained unless explicitly selected.
0 commit comments