Remove `display_soc_toggle =...` and `display_diff_toggle=...` in `ae_forestly()`?
评估
这个 Issue 还没有评估数据。
描述
Motivated example
Observation: columns of count (i.e., the 'n" column) and the percentages columns (i.e., the "%" column) are displayed before the "AE proportion (%)" and "risk difference (%) + 95% CI vs. Low Dose"
Expection: the "n" and "%" columns should be displayed at the end of the table
library(metalite)
library(forestly)
adsl <- forestly_adsl
adae <- forestly_adae
adsl$TRTA <- factor(forestly_adsl$TRT01A,
levels = c("Xanomeline Low Dose", "Placebo"),
labels = c("Low Dose", "Placebo")
)
adae$TRTA <- factor(forestly_adae$TRTA,
levels = c("Xanomeline Low Dose", "Placebo"),
labels = c("Low Dose", "Placebo")
)
meta <- meta_adam(population = adsl, observation = adae) |>
define_plan(plan = plan(
analysis = "ae_forestly",
population = "apat",
observation = "apat",
parameter = "any;drug-related"
)) |>
define_analysis(name = "ae_forestly", label = "Interactive Forest Plot") |>
define_population(
name = "apat", group = "TRTA", id = "USUBJID",
subset = SAFFL == "Y", label = "All Patient as Treated"
) |>
define_observation(
name = "apat", group = "TRTA",
subset = SAFFL == "Y", label = "All Patient as Treated"
) |>
define_parameter(
name = "any",
subset = NULL,
label = "Any AEs",
var = "AEDECOD", soc = "AEBODSYS"
) |>
define_parameter(
name = "drug-related",
subset = toupper(AREL) == "RELATED",
label = "Drug-related AEs",
var = "AEDECOD", soc = "AEBODSYS"
) |>
meta_build()
# Analysis Execution## Generate Interactive Forest Plot
meta |>
prepare_ae_forestly(components = "soc",
population = "apat",
observation = "apat",
reference_group = 1,
parameter = "any;drug-related" ) |>
format_ae_forestly(display = c("fig_prop", "fig_diff", "n", "prop" )) |>
ae_forestly(display_soc_toggle = FALSE,
display_diff_toggle = TRUE,
filter = c("prop", "n"),
filter_range = c(0,20),
width = 1400)
Root cause investigated by GPT6.1 Sol
This is a column-ordering bug in the installed packages, triggered by display_soc_toggle = FALSE.
Here’s what happens:
- forestly creates the numeric n and % columns, then adds the two plots.
- It tries to move the plots before the numeric columns using:
lt::lt_move(x, c("prop_fig", "diff_fig"), after = "soc_name")
- But
display_soc_toggle = FALSEhides soc_name. The lt renderer removes hidden columns before applying the move. With the anchor missing, it silently skips the move.
Consequently, n and % stay before the plots. I reproduced this behavior using your installed forestly 0.1.7 and lt 0.4.49.
The order of entries in display = c("fig_prop", "fig_diff", "n", "prop") does not control the column order. The robust package fix is to anchor the move after the always-visible "name" column instead of "soc_name".
Question
As we have "Show/Hide Columns", shall we still keep the arguments of display_soc_toggle =... and display_diff_toggle=... in ae_forestly()?
- 主要语言
- R
- 星标
- 22
- 派生
- 6
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 7
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Merck/forestly 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
-
Partial display of the interactive AE forest plot when the brower zooms in可能已有人在做 @yihui 于 6 天前认领。 未关闭
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 58/100
-
难度 3/5 1-2 天 新手友好度 48/100
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
nf-core/nanostring#195 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 87/100
-
upkeep
难度 2/5 1-3 小时 新手友好度 64/100
tidyverse/ellmer#1220 · 1 条评论 ·
维护者通常 4 天内回复
-
status:fix-merged
难度 2/5 1-3 小时 新手友好度 76/100
ichirio/rtfreporter#928 ·
维护者通常 1 天内回复
-
bug key bindings source editor
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复