Skip to content

Fix/rename uncond exact diff method - #1547

Open
gwangjinkim wants to merge 2 commits into
pharmaverse:mainfrom
gwangjinkim:fix/rename-uncond-exact-diff-method
Open

gwangjinkim wants to merge 2 commits into
pharmaverse:mainfrom
gwangjinkim:fix/rename-uncond-exact-diff-method

Conversation

@gwangjinkim

Copy link
Copy Markdown
Contributor

Pull Request

Fixes #1534

Summary

Renames the proportion difference method "uncond_exact_diff" to "uncond_exact" in estimate_proportion_diff() and s_proportion_diff(). The statistic names become diff_uncond_exact and diff_ci_uncond_exact_l / _u (previously diff_ci_uncond_exact_diff_l / _u), consistent with the other methods and with prop_diff_uncond_exact().

Because "uncond_exact_diff" was released in 0.9.11 and 0.9.12, it is not removed: it is still accepted, gives a lifecycle deprecation warning, and is mapped to "uncond_exact".

Changes

  • R/prop_diff.R: new default method choices; s_proportion_diff() accepts the deprecated name and converts it (so estimate_proportion_diff() is covered too, including named scalars); d_proportion_diff() describes both names without warning; docs and error messages updated.
  • man/prop_diff.Rd and the uncond_exact_prop_diff_ci.Rmd vignette updated.
  • NEWS.md: entry under "Deprecations".
  • Tests: existing tests use the new name; added tests for the new statistic names, the deprecated alias, and the d_proportion_diff() labels.

Notes

Anyone who referred to the old statistic names (e.g. diff_ci_uncond_exact_diff_l) will see them change. That is the intent of the issue, but it may deserve a mention in the release notes.

Testing

test-prop_diff.R: 51/51 pass with no warnings; test-test_proportion_diff.R and test-utils_split_fun.R also pass. Lint and style are clean.

claude added 2 commits October 8, 2026 16:03
…act" (pharmaverse#1534)

The `_diff` suffix made the statistic names awkward
(`diff_ci_uncond_exact_diff_l`) and was inconsistent with the other
methods and with `prop_diff_uncond_exact()`.

The method is now `"uncond_exact"`, giving `diff_uncond_exact` and
`diff_ci_uncond_exact_l` / `_u`. Since `"uncond_exact_diff"` was released in
0.9.11, it is still accepted by `s_proportion_diff()` (and therefore
`estimate_proportion_diff()`), but gives a lifecycle deprecation warning and
is mapped to the new name. `d_proportion_diff()` keeps describing the old name.

Updates the docs, vignette, error messages, NEWS, and tests (including
coverage of the deprecated alias).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu112DJEVzgWdVGVuiYj7x
`identical(method, "uncond_exact_diff")` is FALSE for a named scalar such as
`config["method"]`, which `match.arg()` used to accept. Such a value then
skipped the compatibility mapping and was rejected by the new choices.
Compare the value with `isTRUE(method == ...)` instead, and cover the named
case in the deprecation test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu112DJEVzgWdVGVuiYj7x

This branch has not been deployed

No deployments
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.

Unfortunate proportion difference method name: "uncond_exact_diff".

2 participants