Skip to content

Sort AE forest plots by descending risk difference by default - #189

Open
LittleBeannie wants to merge 1 commit into
mainfrom
188-sort-the-ae-forest-plot-by-descending-order-of-the-risk-difference
Open

LittleBeannie wants to merge 1 commit into
mainfrom
188-sort-the-ae-forest-plot-by-descending-order-of-the-risk-difference

Conversation

@LittleBeannie

Copy link
Copy Markdown
Collaborator

Summary

Display AE rows in descending risk-difference order by default, making events with the largest positive differences easier to identify.

Fixes #188.

Changes

  • Sort within each AE criterion using the unrounded risk difference for the first treatment comparison.
  • Preserve the original order for ties and place missing estimates last.
  • Keep labels, counts, proportions, confidence intervals, and plots aligned.
  • Preserve pagination metadata and drill-down mappings.
  • Retain the input order when no risk-difference comparison is available.
  • Add regression tests, documentation, and a release note.

Validation

  • All 63 targeted test assertions passed.
  • R package build passed.
  • Browser checks confirmed correct row ordering, pagination, AE-criteria filtering, incidence filtering, and drill-down listings.

@LittleBeannie LittleBeannie self-assigned this Dec 3, 2026
@LittleBeannie LittleBeannie changed the title Sort the AE forest table by diff Sort AE forest plots by descending risk difference by default Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

Site preview: https://merck-forestly-pr-189.surge.sh

Updates on every push; removed when this PR closes.

@yihui yihui left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorting can be done on the lt side (you can pre-specify the columns to be sorted): https://pkg.yihui.org/lt/book/#sec:sort which is probably simpler than doing it on the R side. Would that work?

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.

Sort the AE forest plot by descending order of the risk difference

2 participants