-
Notifications
You must be signed in to change notification settings - Fork 63
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: Use dplyr::left_join(relationship)
argument
#2247
Comments
Our functions expect "many-to-one" but do not use the |
But not every join users do will be many to one. This would allow them to specify, for example, one-to-one when that is the situation they are in. |
Yes, we could add an |
I think the default should be |
The argument should be |
dplyr::left_join(relationship)
argumnetdplyr::left_join(relationship)
argument
Functions which use
I believe these are all the functions that use one of |
Rock on @sophie-gem !! |
Hi @bms63, @ddsjoberg - if you get the chance, would you be able to review this change I've made in the above commit to the first function in the list? (Thinking if I ensure this is ok before I continue it will save some review time at the end...). Also, two questions:
|
I think we don't need the At the moment duplicates produce incorrect results. Consider for example:
|
Note to self: look at how to 'catch' error for |
Hi @sophie-gem - we have a release on June 3rd. Do you think you can complete updates before then? |
I am planning on it! Will aim to have it complete by end of next week - is that ok? |
…uplicates in the `lookup_table` and create associated test.
Hi all, In the function documentation for |
Yes, that's a left-over from replacing |
…to only allow one-to-one and many-to-one relationship values according to feedback.
Merge branch 'main' into 2247_left_join_relationship # Conflicts: # NEWS.md
…hip error in `derive_merged.R`, `derive_vars_transposed.R`.
…es with parent function argument names.
* #2247 - added `relationship` argument to `create_single_dose_dataset()`. * #2247 - Update `derive_vars_merged()` function with relationship argument. * #2247 - Update `create_single_dose_dataset()` according to feedback. Set `relationship = many-to-one`. * #2247 - add in assertion to check new `relationship` argument contains only the options allowed. * #2247 - Update `create_single_dose_dataset()` to error if there are duplicates in the `lookup_table` and create associated test. * #2247 - Update `derive_vars_transposed()` with relationship argument. * #2247 - Update NEWS.md, running `styler::style_pkg()`, `lintr::lint_package()` * #2247 - Update documentation to ensure URLs are inserted as links as opposed to plain text. * #2247 - Update to use `signal_duplicate_records()` as recommended by feedback. * #2247 - Revert unintended changes to `test-derive_var_atoxgr.R` * #2247 - Update `derive_vars_merged()` and `derive_vars_transposed()` to only allow one-to-one and many-to-one relationship values according to feedback. * #2247 - Update according to review comment. Catch the dplyr relationship error in `derive_merged.R`, `derive_vars_transposed.R`. * #2247 - Update documentation for `get_hori_data()` due to misaligned text. * #2247 - Running final devtools checks. * Update R/derive_merged.R Apply requested change. Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> * #2247 - Update functions to take dplyr error and replace argument names with parent function argument names. * #2274 - Forgot to remove some dummy testing code! Have now removed. * #2247 - Re-run devtools checks. * docs: #2247 clarify arguments; tests: snapshot of my life * chore: #2247 lintr * tests: #2247 new snapshot * chore: #2247 that lint life --------- Co-authored-by: Ben Straub <ben.x.straub@gsk.com> Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com>
Feature Idea
Our merging functions are (very) fancy joins with many useful options. In dplyr 1.1.1, the
dplyr::left_join(relationship)
argument that allows users to specify the expected type of merge that will be performed.For example, if you specify
relationship = "one-to-one"
the function will error if there is more than one match on the by variables.I think it can be useful to our users to add this argument to our functions.
Relevant Input
No response
Relevant Output
No response
Reproducible Example/Pseudo Code
No response
The text was updated successfully, but these errors were encountered: