Skip to content

Conversation

venom1204
Copy link
Contributor

closes #5457

this pr

Clarifies .I docs in joins with by = .EACHI:

Column lookup = NA

.I / .N on unmatched groups → 0

Docs updated, no behavior change.

hi @MichaelChirico @tdhock can you please have a look when you got time
thanks.

Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@c27ec26). Learn more about missing BASE report.
⚠️ Report is 35 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #7258   +/-   ##
=========================================
  Coverage          ?   98.79%           
=========================================
  Files             ?       81           
  Lines             ?    15254           
  Branches          ?        0           
=========================================
  Hits              ?    15070           
  Misses            ?      184           
  Partials          ?        0           

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


The reason for this difference is crucial:
- In Case 1, we are performing a value lookup. A failed lookup results in a missing value (`NA`).
- In Case 2, we are performing an evaluation. The symbol `.I` is defined as "the row indices in `x` for the current group". For non-matching rows like `D`, the group of matching rows in d1 is empty. The set of indices for an empty group is integer(0). data.table represents this zero-length result as a single `0` in the output.
Copy link
Member

Choose a reason for hiding this comment

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

where does this info come from?

@ben-schwen
Copy link
Member

Not sure data.table.Rd is the right place. Would rather put it into special-symbols.Rd

@ben-schwen
Copy link
Member

ben-schwen commented Aug 22, 2025

Tbh I would also rather fix it than adopting documentation.

edit: this should then also close #3452

@venom1204 venom1204 marked this pull request as draft August 24, 2025 11:13
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.

Understanding the value of .I for non-matching rows when using .EACHI
2 participants