Reproduce clinical breakpoints from latest WHONET/AMRIE data#266
Open
Reproduce clinical breakpoints from latest WHONET/AMRIE data#266
Conversation
- Ran reproduction_of_microorganisms.groups.R and reproduction_of_clinical_breakpoints.R against the latest WHONET/AMRIE source (includes EUCAST 2026, CLSI 2025) - Updated data/clinical_breakpoints.rda, microorganisms.codes.rda, microorganisms.groups.rda, and data-raw/organisms.rds - Fixed reproduction_of_microorganisms.groups.R: replaced base ifelse() with dplyr::if_else() to preserve the <mo> S3 class; base ifelse() strips class attributes, causing bind_rows() to fail with strict vctrs type checking in dplyr >= 1.1.0 - Added data-raw/_run_reproduction.R: non-interactive wrapper that overrides View(), sets UTF-8 locale, and sources both scripts in the correct order https://claude.ai/code/session_01S5vMqfsiJb59RN2Gyz1tDY
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.
Summary
data/clinical_breakpoints.rda,data/microorganisms.codes.rda,data/microorganisms.groups.rda, anddata-raw/organisms.rdsreproduction_of_microorganisms.groups.R: replaced baseifelse()withdplyr::if_else()to preserve the<mo>S3 class — baseifelse()strips class attributes, causingbind_rows()to fail with strict vctrs type checking in dplyr ≥ 1.1.0data-raw/_run_reproduction.R: a non-interactive wrapper that overridesView(), sets the UTF-8 locale, and sources both scripts in the correct order (groups script first, then breakpoints)Flaws encountered and fixed
bind_rows()type error inmicroorganisms.groupsscriptbase::ifelse()strips<mo>class → producescharacter; laterbind_rows()with<mo>tibbles fails under vctrs strict typingdplyr::if_else()withoutas.character()wrappergsub()UTF-8 pattern error in breakpoints scriptC/POSIX, rejecting multi-byte Unicode ingsub()patternsC.utf8in the wrapper before sourcing scriptsView()calls abort non-interactive sessionView()not meaningful outside RStudio/GUITest plan
clinical_breakpointsdimensions increased (now includes EUCAST 2026)clinical_breakpoints |> filter(guideline == "EUCAST 2026", ab == "AMC", mo == "B_[ORD]_ENTRBCTR", method == "MIC")microorganisms.codesandmicroorganisms.groupsload without errors afterdevtools::load_all()https://claude.ai/code/session_01S5vMqfsiJb59RN2Gyz1tDY