Skip to content

Add suffix arg to compare() and weave_diffs_wide() + close #20#34

Closed
elipousson wants to merge 13 commits intoeutwt:mainfrom
elipousson:main
Closed

Add suffix arg to compare() and weave_diffs_wide() + close #20#34
elipousson wants to merge 13 commits intoeutwt:mainfrom
elipousson:main

Conversation

@elipousson
Copy link

Thanks for a great package. I hope this PR is welcome. If you have questions or suggestions, please let me know!

I was interested in adding a suffix argument to compare() and weave_diffs_wide() and thought I'd work on #20 while I was in the code. Here are the key changes:

  • compare() now supports a custom function for checking equivalence between column values. The existing internal function not_equal() is used by default and is now exported FR: user supplied function for detecting differences #20

  • compare() and weave_diffs_wide() both now support a suffix argument to allow custom suffix values for column names when comparing data frames.

I also updated the package docs and tidied the DESCRIPTION with usethis.

Also:

- Export not_equal as an internal function
- Make sure `not_equal` returns an index for allow_both_NA = FALSE and allow_both_NA = TRUE
Also add support for `suffix` argument to `compare()`
Also tidy DESCRIPTION w/ `use_tidy_description()`
Add `pull_comparison_table()` and `match_table()` helper

Also update test snapshots
@eutwt eutwt mentioned this pull request Oct 12, 2025
@eutwt
Copy link
Owner

eutwt commented Oct 12, 2025

Thanks! I like the idea. To simplify things, I think the table_id provided to compare() can be used for all functions, so I've created another PR #36 to implement it that way. I'd be interested to know your thoughts on the approach there.

I think we can add the user-supplied comparison in a separate PR

@elipousson elipousson closed this Nov 21, 2025
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.

2 participants