Merge and [ should have an argument for avoid matching of NA

Open
#819 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start with the merge and [ entry points shown in the issue, and compare their current NA-matching behavior with the requested SQL-style behavior. Define how an opt-out argument should apply to both operations, then use the supplied data.table example to verify that NA rows no longer match while ordinary values still do.

Written by the indexing model from the issue text.

Description

consistency feature request joins

Actually, NA matches NA in both merge and [. To emulate SQL behavior, there should be an argument to avoid NA matching with anything

d = data.table
d(a=c(1:2,NA,NA))[d(a=c(2:3,NA,NA)), on="a"]
# should return only 2:3
Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.