Skip to content

Commit

Permalink
Update vignettes/datatable-joins.Rmd
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Chirico <[email protected]>
  • Loading branch information
venom1204 and MichaelChirico authored Feb 25, 2025
1 parent da0931d commit 008cadf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vignettes/datatable-joins.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,9 @@ i <- data.table(i_int = c(2, 4, 5), UPPER = LETTERS[1:3])
x[i, on = .(x_int >= i_int)]
```
Key Takeaways:
- The name of the output column (x_int) comes from x, but the values come from i_int in i.
- The last row contains NA because no rows in x match the last row in i (UPPER = "C").
- Multiple rows in x are returned to match the first row in i with UPPER = "A".
- The name of the output column (`x_int`) comes from `x`, but the values come from `i_int` in `i`.
- The last row contains `NA` because no rows in `x` match the last row in `i` (`UPPER == "C"`).
- Multiple rows in `x` are returned to match the first row in `i` with `UPPER == "A"`.

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

Expand Down

0 comments on commit 008cadf

Please sign in to comment.