insightsengineering / insightsengineering/teal.transform
allow data_extract_input to work with "interaction" variables
- Dominant language
- R
- Stars
- 2
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
In `teal.modules.clinical::tm_a_mmrm`, one of the variables needed for the analysis allows for "interaction" terms. These are passed into the template in this form: `variable1:variable2` or `variable1*variable2`.
If we are using a `data_extract_input` and `data_merge_module`, these variables do not exist in the data - but their component variables do (and they must).
What we need from `data_extract_input` is to *optionally* accept some split criteria to separate interaction selections into their component variables. Or maybe this has to be done at the `data_merge_module` level.
The goal is to enable something like this:
```r
data_extract_spec(
dataname = dataname,
select = select_spec(
choices = c("BASE", "AGE", "SEX", "BASE:AVISIT")
)
)
```
Such that the `data_extract_input` shows this in the module:

But is doing this behind the scenes (Show R Code):

Note how the "variables" being selected are `BASE`, `AVISIT`, and `SEX` (`BASE:AVISIT` has been split).
You may see the current workaround in `tm_a_mmrm` which currently uses 2 `data_extract_inputs` to accomplish this.
Provenance:
```
Creator: SUNDRELV
```
Contributor guide
Assessment
This issue has not been assessed yet.