Skip to content

Use data prefix for n - #160

Merged
llrs-roche merged 8 commits into
mainfrom
159_label_n
Nov 6, 2026
Merged

llrs-roche merged 8 commits into
mainfrom
159_label_n

Conversation

@llrs-roche

@llrs-roche llrs-roche commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Fixes #159

Use values instead of showing the name of the column

See the issue for the before, now we see:

image

@llrs-roche
llrs-roche marked this pull request as ready for review November 5, 2026 13:34
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

badge

Code Coverage Summary

Filename                   Stmts    Miss  Cover    Missing
-----------------------  -------  ------  -------  ---------
R/g_ae_sub.R                 346     346  0.00%    147-542
R/g_butterfly.R              192     192  0.00%    104-328
R/g_events_term_id.R         268     268  0.00%    129-498
R/g_heat_bygrade.R           210     210  0.00%    139-371
R/g_hy_law.R                  81      81  0.00%    119-203
R/g_patient_profile.R        392     392  0.00%    294-960
R/g_spiderplot_simple.R       27      27  0.00%    37-66
R/g_spiderplot.R             174     174  0.00%    109-345
R/g_swimlane.R               139     139  0.00%    119-320
R/g_waterfall.R              306     306  0.00%    146-506
R/stream_filter.R            125     125  0.00%    34-295
R/utils.R                    153     153  0.00%    43-362
TOTAL                       2413    2413  0.00%

Diff against main

Filename           Stmts    Miss  Cover
---------------  -------  ------  --------
R/g_butterfly.R       +9      +9  +100.00%
TOTAL                 +9      +9  +100.00%

Results for commit: a2725ef

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@osenan osenan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is ok, but I suggest two changes:
Don't you think that it needs to be mentioned in documentation that the AE count is shown by subcategory and by bar and that the total is shown?
I think that the number of teach geom_text should be at the middle of the bar, like this post:
https://www.researchgate.net/figure/Butterfly-plot-comparing-the-frequencies-of-adverse-events-between-the-placebo-left_fig5_379695609
I was trying to use this https://stackoverflow.com/questions/41877645/geom-text-position-middle-on-a-bar-plot but it does not work. But I think it will be clearer if the individual count is at the center of the bar and the total is slightly separated

@llrs-roche

Copy link
Copy Markdown
Contributor Author

I have updated the documentation.

See also 4a54529 for the improvement suggested on the labels and see the current output:

image

Currently the labels are symmetric (in the sense they are touching the bars on both sides) and centered for each group.

I haven't addressed the issue of the labels that cannot be read. I think it would add too much complication and can be easily deduced from the total number. An easy change would be to use labels with white background (so replace geom_text() with geom_label() ) this would be simple enough but I wouldn't like to do that change.

I've also tested that it works with faceting:

image

@osenan osenan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for making the changes! I think the plot looks much better now.

@llrs-roche
llrs-roche enabled auto-merge (squash) November 6, 2026 11:57
@llrs-roche
llrs-roche merged commit f15ac09 into main Nov 6, 2026
26 checks passed
@llrs-roche
llrs-roche deleted the 159_label_n branch November 6, 2026 12:01
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Hard-coded label on g_butterfly

2 participants