Skip to content

Commit 6d026bd

Browse files
committed
removed the temporary part
1 parent 06286b9 commit 6d026bd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

vignettes/datatable-joins.Rmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,6 @@ When performing non-equi joins (<, >, <=, >=), column names are assigned as foll
580580
In non-equi joins, the left side of the operator (e.g., x_int in x_int >= i_int) must be a column from x, while the right side (e.g., i_int) must be a column from i. Non-equi joins do not support arbitrary expressions.
581581
For example, on = .(x_int >= i_int) is valid, but on = .(x_int >= i_int + 1) is not valid.
582582

583-
If you need to apply transformations, create a temporary column first.
584-
585583
```{r}
586584
x <- data.table(x_int = 2:4, lower = letters[1:3])
587585
i <- data.table(i_int = c(2, 4, 5), UPPER = LETTERS[1:3])
@@ -597,6 +595,7 @@ If you want to keep the i_int column from i, you need to explicitly select it in
597595
```{r}
598596
x[i, on = .(x_int >= i_int), .(i_int = i.i_int, x_int = x.x_int, lower, UPPER)]
599597
```
598+
This ensures the output clearly distinguishes i_int (from i) and x_int (from x).
600599

601600
If you want to exclude unmatched rows, you should use nomatch = NULL:
602601

0 commit comments

Comments
 (0)