Skip to content

Commit b29de8e

Browse files
committed
bacticks corrected
1 parent 29e768a commit b29de8e

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

vignettes/datatable-joins.Rmd

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,12 @@ ProductReceivedProd2[ProductSalesProd2,
573573

574574
When performing non-equi joins (<, >, <=, >=), it's important to understand how column names are assigned in the result.
575575

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.
579579

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.
582582

583583
Arbitrary comparisons can be accomplished by create temporary columns first. For example:
584584

@@ -587,10 +587,10 @@ x <- data.table(A = 1:5, value_x = letters[1:5])
587587
i <- data.table(B = c(2, 4, 5), value_i = LETTERS[1:3])
588588
x[i, on = .(A >= B)]
589589
```
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.```
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.
591591

592592
Expected Output
593-
A value_x value_i
593+
A value_x value_i
594594
1: 2 b A
595595
2: 4 d B
596596
3: 5 e C
@@ -610,9 +610,6 @@ Updated Output
610610
3: 5 5 e C
611611
4: 5 5 e C
612612

613-
Now, B from i is explicitly retained in the final table.
614-
615-
`important Consideration: nomatch = NULL in Non-Equi Joins`
616613
If you want to exclude unmatched rows, you should use nomatch = NULL:
617614

618615
```{r}

0 commit comments

Comments
 (0)