Skip to content

Commit a6b99b9

Browse files
committed
updated section
1 parent 66da346 commit a6b99b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vignettes/datatable-joins.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ For example, `on = .(x_int >= i_int)` is valid, but `on = .(x_int >= i_int + 1)`
582582

583583
We plan to allow arbitrary expressions eventually, see [#1639](https://github.com/Rdatatable/data.table/issues/1639).
584584

585-
```{r}
585+
```{r non_equi_join_example}
586586
x <- data.table(x_int = 2:4, lower = letters[1:3])
587587
i <- data.table(i_int = c(2, 4, 5), UPPER = LETTERS[1:3])
588588
x[i, on = .(x_int >= i_int)]
@@ -594,7 +594,7 @@ Key Takeaways:
594594

595595
If you want to keep the i_int column from i, you need to explicitly select it in the result:
596596

597-
```{r}
597+
```{r retain_i_column}
598598
x[i, on = .(x_int >= i_int), .(i_int = i.i_int, x_int = x.x_int, lower, UPPER)]
599599
```
600600
This ensures the output clearly distinguishes i_int (from i) and x_int (from x).

0 commit comments

Comments
 (0)