Skip to content

Commit 6aa99f5

Browse files
Merge pull request #6868 from venom1204/issue1945
fix : Added Examples of Named List Elements in i to Improve Clarity
2 parents 538c491 + f626801 commit 6aa99f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vignettes/datatable-secondary-indices-and-auto-indexing.Rmd

+8
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,14 @@ flights[.("JFK", "LAX"), on = c("origin", "dest")][1:5]
191191

192192
* Since the time to compute the secondary index is quite small, we don't have to use `setindex()`, unless, once again, the task involves repeated subsetting on the same column.
193193

194+
* For clarity/readability, it might help to name the inputs in `i`, e.g.,
195+
196+
```{r}
197+
flights[.(origin = "JFK", dest = "LAX"), on = c("origin", "dest")]
198+
```
199+
200+
This makes it clear which entries in `j` correspond to which element of `on`.
201+
194202
### b) Select in `j`
195203

196204
All the operations we will discuss below are no different to the ones we already saw in the [`vignette("datatable-keys-fast-subset", package="data.table")`](datatable-keys-fast-subset.html) vignette. Except we'll be using the `on` argument instead of setting keys.

0 commit comments

Comments
 (0)