Implement harmonize_fct()#36
Merged
Merged
Conversation
Closes #3.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Implements factor harmonization functionality and refactors the factor specification away from an S7 class to a lightweight list-based spec.
- Adds harmonize_fct() with lookup support and tests.
- Replaces S7-based hrmn_fct spec with list-based hrmn_fct_spec and updates tests/docs.
- Removes S7 dependency; adds fastmatch, rlang, and stbl dependencies.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-specify_fct.R | Updates tests to reflect new list-based spec class and accessor ($ instead of @). |
| tests/testthat/test-harmonize_fct.R | Adds comprehensive tests for harmonize_fct() behavior (empty input, lookup, NA handling, spec enforcement). |
| R/specify_fct.R | Refactors specify_fct() to return a list-based spec with new class vector. |
| R/harmonize_fct.R | Introduces harmonize_fct() and internal .apply_fct_lookup(). |
| R/aaa-shared_params.R | Adds shared parameter documentation for reuse. |
| R/hrmn-package.R | Imports fastmatch %fin% operator. |
| man/*.Rd | Updates and adds documentation for new/modified functions. |
| NAMESPACE | Exports harmonize_fct() and imports %fin%; removes S7 import. |
| DESCRIPTION | Bumps version; updates Imports (removes S7, adds fastmatch, rlang, stbl). |
| R/zzz.R | Removes obsolete S7-related helper. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3.