Repository navigation
Harmonize the API with soft deprecation: ceac(psa, wtp), linewidth, axis limits, effect_units (#214) - #251
Merged
Conversation
…idth, axis limits, effect_units
- ceac() takes the psa object first, like calc_exp_loss() and calc_evpi(). The old positional
ceac(wtp, psa) still works with lifecycle::deprecate_soft(); named calls work in any order.
- plot.owsa() and plot.exp_loss() take linewidth; size and lsize still work, deprecated.
- plot.owsa() and plot.twsa() gain xlim/ylim, owsa_opt_strat() gains xlim.
- effect_units defaults to "QALYs" in every plot; per_unit() gives the singular for
willingness-to-pay labels, so default labels are unchanged ("$/QALY").
- lifecycle (>= 1.0.0) added to Imports.
- API style decision record in .github/CONTRIBUTING.md, including the open 2.0 questions.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 209-reference-strategy-core #251 +/- ##
===============================================================
+ Coverage 93.69% 93.83% +0.14%
===============================================================
Files 18 18
Lines 2013 2028 +15
===============================================================
+ Hits 1886 1903 +17
+ Misses 127 125 -2
🚀 New features to boost your workflow:
|
The minimum-dependency CI job could not install ggplot2@3.5.0 with lifecycle@1.0.0.
…o HEAD # Conflicts: # NEWS.md
Current dplyr needs lifecycle (>= 1.0.5) and ggplot2 3.5.0 needs lifecycle (> 1.0.1), so any lower pin makes the minimum-dependency environment unsolvable. dampack only uses deprecate_soft(), deprecated() and is_present(), which predate lifecycle 1.0.
feralaes
added a commit
that referenced
this pull request
Nov 14, 2026
This was referenced Nov 14, 2026
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 #214.
Base: this PR is built on #227 (
209-reference-strategy-core), because it changes the plot methods that #227 and #242 also change. When #227 merges, GitHub retargets this PR tomain.Nothing breaks. Every v1.0.x call still works, and the old forms give one soft deprecation warning through
lifecycle::deprecate_soft().Changes
ceac(psa, wtp)ceac()now takes thepsaobject first, likecalc_exp_loss(),calc_evpi(),calc_evppi()andcalc_evsi().ceac(wtp, psa)is detected because its second argument is apsaobject. It's swapped, and it warns: "Thewtpargument ofceac()must come afterpsaas of dampack 1.1.0. Useceac(psa, wtp)…"ceac(wtp = , psa = )) work in any order without a warning. The vignettes and thedf_example_psa_elcexample already use them.linewidthplot.owsa(size = )andplot.exp_loss(lsize = )becomelinewidth, the name ggplot2 itself uses.Axis limits
plot.owsa()andplot.twsa()gainxlimandylim. Inplot.owsa()the limits apply to every panel.owsa_opt_strat()gainsxlim. Its y axis is categorical, so it has noylim.effect_units"QALYs"everywhere. Before, it was"QALYs"inplot.icers()and"QALY"elsewhere.per_unit(). That's whatwtp_caption()already did."Effect (QALYs)","Thousand $/QALY","WTP = $50,000/QALY".effect_units = "life-years"gives"$/life-year", and a unit already in the singular is used as given.API style decision record
.github/CONTRIBUTING.md. It records:summary.ceac()column rename (Correct summary.ceac rows when the frontier switches twice or more #173) as an accepted minor break.calc_versuscalculate_;effectversuseffectiveness;Dependencies:
lifecycleadded to Imports, with no version bound, likedplyrandtidyr. Current dplyr already needs lifecycle 1.0.5, so a lower pin made the minimum-dependency environment unsolvable (the CI job caught this twice). dampack only usesdeprecate_soft(),deprecated()andis_present().What I didn't add, and why
The issue listed
colas missing fromplot.icers(),plot.evpi()andplot.evppi().plot.icers()tells statuses apart by shape and line type, not color, and the two VOI plots draw a single line. Acolargument would have no effect, so the decision record sayscolexists only where strategies or groups are colored. If the group wants colored ICER plots, that would be a new feature for v1.2.Tests
New
test_api_harmonize.R, with 24 expectations:ceac()call forms give identical results, and only the old positional one gives a deprecation (lifecycle::expect_deprecated());sizeandlsizemap tolinewidth, with a deprecation;per_unit()handles plural and singular units.Existing tests now use
ceac(psa, wtp)andlinewidth.Verification
devtools::test(): 500 passed, 0 failed. The only 3 warnings are mgcv's intest_metamod.R.lintr: 0 lints.R CMD check --as-cran: only the development-version NOTE.