-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feature Request: join_many_to_one() and join_one_to_one() #6307
Comments
You might like the new |
@DavisVaughan , Thanks for pointing those out. Those are very close to the request! In my ideal world, this would have a bit more granularity in the required matching. As an example, I see that "error" would be the desired behavior for requiring a 1:1 match. But, I sometimes want matches to have the following characteristics at the same time: Overall, there are a lot of potential scenarios between the
Am I missing control abilities? |
Obviously not as convenient as having it built into a join function, but you might check out these functions from the {dm} package if you haven't already. https://cynkra.github.io/dm/reference/examine_cardinality.html Edit: I missed that you already implemented it, so probably aren't looking for solutions in general but just proposing a dplyr feature. Oops. Oh well, I'll leave the link in case its useful to others. |
@eutwt , Thanks for the pointer to {dm}. I like several of the things that the package provides, and it seems to cover some of the space of what I'm looking for. I do prefer the join to be combined with the check so that it has a combined success or failure. (Though I understand the benefits of the separation, too.) Though your subsequent read is correct, I have implemented it for myself and was hoping to make it available to others. |
Thanks for filing this issue! Unfortunately, I think it's unlikely we'll work on it in the short term because we've already spend a considerable amount of time analysing the features that folks need and implementing what we believe is the best tradeoff for payoff and implementation effort. |
Related to sfirke/janitor#427
I often need to perform join operations which confirm that the join is either 1:1 or many:1. Is there interest in this and similar functions to confirmation the result of join operations?
The underlying idea is to ensure a connection between rows in a data.frame on both the left and right side of the join with a
join_controller()
function. Thejoin_controller()
function ensures that a row is matched on the left or right data.frame:join_one_to_one()
andjoin_many_to_one()
are special cases of the above controls.I've implemented it here: sfirke/janitor#480
Created on 2022-06-24 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: