pharmaverse / pharmaverse/rtables
Coexistence of trim_levels_to_map() and add_combo_levels().
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 260
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Is there any reason why the STUDYID column in the map is ignored in the layout below?
map <- tribble(
~ARM, ~STUDYID,
"A: Drug X", "n",
"B: Placebo", "mean"
)
combo_df <- tribble(
~valname, ~label, ~levelcombo, ~exargs,
"n", "n", select_all_levels, list(),
"mean", "mean", select_all_levels, list(),
)
lyt <- basic_table() |>
split_cols_by("ARM", split_fun = trim_levels_to_map(map)) |>
split_cols_by("STUDYID", split_fun = add_combo_levels(combo_df)) |>
analyze("BMRKR1", afun = simple_analysis)
tbl <- build_table(lyt, ex_adsl)
tbl
A: Drug X B: Placebo
n mean n mean
———————————————————————————————————
Mean 5.97 5.97 5.70 5.70
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the implementations and tests for trim_levels_to_map() and add_combo_levels(), then run the reproducible layout using ex_adsl. Trace how the STUDYID map values are handled during build_table(); done means the interaction is explained and, if unintended, covered by a regression test and corrected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100