insightsengineering / insightsengineering/chevron
[feature request] grouped overall columns
- Dominant language
- R
- Stars
- 19
- Forks
- 1
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
the user would like to be able to do something like:
```r
adsl_mod <- syn_data$adsl %>%
mutate(collapse_TRT = case_when(TRT01P %in% c("A: Drug X")~ "A",
TRT01P %in% c("B: Placebo", "C: Combination")~ "BC"))
result <- basic_table(show_colcounts = TRUE) %>%
# Split columns by treatment arms
split_cols_by(var = "TRT01P") %>%
# Add custom total columns for selected treatments
add_overall_col("Total by treatment grouping") %>%
split_cols_by(var = "collapse_TRT") %>%
add_overall_col("All Patients") %>%
# Analyze variables
analyze_vars(
vars = c("AGE", "SEX", "ETHNIC", "RACE", "BMRKR1"),
var_labels = c(
"Age (yr)",
"Sex",
"Ethnicity",
"Race",
"Continous Level Biomarker 1"
)
) %>%
build_table(adsl_mod)
result
```
Contributor guide
Research direction
Start by tracing the existing basic_table, split_cols_by, add_overall_col, analyze_vars, and build_table entry points to understand how column groups are represented. Compare the example's grouped totals with current behavior and define tests showing that selected treatment groups and the all-patients total are produced correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100