Refactor scalar case_when() branches in convert_output() to if/else - #345
Merged
Conversation
Co-authored-by: Schiano-NOAA <125507018+Schiano-NOAA@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor all
Refactor scalar Aug 12, 2026
dplyr::case_when() to dplyr::if_else() in convert_output()case_when() branches in convert_output() to if/else
Schiano-NOAA
marked this pull request as ready for review
August 12, 2026 15:00
Collaborator
|
@copilot please also look through all other functions in the R/ folder and replace case_when with the if else scalar |
Co-authored-by: Schiano-NOAA <125507018+Schiano-NOAA@users.noreply.github.com>
Contributor
Author
Addressed in commit |
Co-authored-by: Schiano-NOAA <125507018+Schiano-NOAA@users.noreply.github.com>
Schiano-NOAA
approved these changes
Aug 13, 2026
Co-authored-by: Schiano-NOAA <125507018+Schiano-NOAA@users.noreply.github.com>
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.
convert_output()contained scalar-conditiondplyr::case_when()branches that trigger dplyr 1.2.x deprecation warnings (size 1 LHSwith vector RHS). This PR replaces those branches with explicitif/elselogic in the affected paths while preserving existing output behavior.Scope
R/convert_output.Rwherecase_when()was being used as control flow rather than vectorized row-wise logic.Code changes
case_when()used to derivesexfromsexescolumn presence with directif/else.case_when()used to mapfleetvalues afterout_new <- Reduce(rbind, out_list)with directif/else.Regression guard
tests/testthat/test-convert_output.Rassertingconvert_output()does not emit warnings for a representative SS3 fixture.dplyr::case_when()todplyr::if_else()inconvert_output()#344