Shipped interactmeta datasets are already long (one row per trial ×
subgroup). If your source tables are wide (one row per trial, columns
suffixed by subgroup such as yi_Younger or n_IV), use this helper before
cams() or escalc(). Metadata on wide tables (subgroups,
subgroup_id_cols, subgroup_value_cols) drives the reshape; you can
override those arguments when needed.
Examples
# Shipped `steroids` is already long; `subgroup_long()` is for wide source tables.
long_steroids <- subgroup_long(steroids)
head(long_steroids[, c("study", "subgroup", "n", "treat.events")])
#> # A tibble: 6 × 4
#> study subgroup n treat.events
#> <chr> <chr> <int> <int>
#> 1 CAPE COVID NIV 28 1
#> 2 CAPE COVID IV 120 10
#> 3 CoDEX NIV 0 0
#> 4 CoDEX IV 256 69
#> 5 COVID STEROID NIV 16 2
#> 6 COVID STEROID IV 13 4
