Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : Added Examples of Named List Elements in i to Improve Clarity #6868

Merged
merged 8 commits into from
Mar 21, 2025

Conversation

venom1204
Copy link
Contributor

@venom1204 venom1204 commented Mar 15, 2025

closes #1945
This PR updates data.table joins to use named lists (on = .(...)) instead of unnamed character vectors (on = c("col1", "col2")).
in this I modified
*** vignettes/datatable-secondary-indices-and-auto-indexing.Rmd:

  • Added a subsection titled "Using named list elements in i" under Fast subsetting using on argument and secondary indices.
  • Demonstrated the difference between unnamed and named list elements with examples for single and multiple keys.

@jangorecki @MichaelChirico can you please review this when you have time.
thanks.

Copy link

codecov bot commented Mar 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.59%. Comparing base (538c491) to head (f626801).
Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6868   +/-   ##
=======================================
  Coverage   98.59%   98.59%           
=======================================
  Files          79       79           
  Lines       14661    14661           
=======================================
  Hits        14455    14455           
  Misses        206      206           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@venom1204 venom1204 marked this pull request as ready for review March 15, 2025 11:26
@@ -191,33 +191,64 @@ flights[.("JFK", "LAX"), on = c("origin", "dest")][1:5]

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

### b) Select in `j`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can shrink the diff in this PR to basically one line. Instead of a new 'c)' entry here, I would add a bullet point here like

  * For clarity/readability, it might help to name the inputs to `i`, e.g. `flights[.(origin = "JFK", dest = "LAX"), on=c("origin", "dest")]`

I'm not convinced any of the other changes add enough value to warrant inclusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelChirico , I've updated the section based on your suggestion. Do you think it needs more detail, or does it look good as is? Whenever you have time, I'd appreciate your review. Thanks!

Copy link
Member

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MichaelChirico MichaelChirico merged commit 6aa99f5 into Rdatatable:master Mar 21, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add examples of named list elements in i
2 participants