镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Clarify .I behavior for non-matching rows in joins with by = .EACHI - #7258

Draft
venom1204 wants to merge 1 commit into
masterfrom
issue_5457
Draft

venom1204 wants to merge 1 commit into
masterfrom
issue_5457

Conversation

@venom1204

Copy link
Copy Markdown
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.

@codecov

codecov Bot commented Aug 21, 2025 •

Copy link
Copy Markdown

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 224 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
Copy Markdown
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
Copy Markdown
Member

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

@ben-schwen

ben-schwen commented Aug 22, 2025 •

Copy link
Copy Markdown
Member

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

This branch has not been deployed

No deployments
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