Skip to content
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

flag argument ? #48

Open
moodymudskipper opened this issue Aug 9, 2023 · 0 comments
Open

flag argument ? #48

moodymudskipper opened this issue Aug 9, 2023 · 0 comments

Comments

@moodymudskipper
Copy link
Owner

It seems to be a common request to be able to identify the matched observation or the source, is flag a good name ?

flag would be a character vector of length 1 to 3 containing either :

  • length 1 : The name of a boolean column that would be TRUE for matched observation
  • length 2 : The names of columns containing TRUE when the observation was matched respectively in .x or .y
  • length 3 : The latter + the former

flag would be NULL by default

Implementation wise we mutate some columns on each side, named as the first 2 elements of flag, or unique temp names from the unique flag element, then join, fill with FALSE, and combine accordingly.

Common use case would probably be :

left_join(x, y, flag ="matched")

left_join(
  x,
  y |> select_keys_and(), 
  flag ="matched"
)

In the latter case select_keys_and() is a bit awkwar, it is worth having select_keys() which would do the same but be more limited in scope and look better ?

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

No branches or pull requests

1 participant