insightsengineering / insightsengineering/teal.transform

relabel columns which has been reshaped (spread) by factor level

Open
#39 1 comment 0 reactions 0 assignees View on GitHub
core
Dominant language
R
Stars
2
Forks
3
PR merge metrics
No merged PRs in 30d

Description

This code in `merge_datasets` relabel only columns which are not spread (get_relabel_cols).

```
anl_relabel_call <- get_anl_relabel_call(
columns_source = get_relabel_cols(columns_source, dplyr_call_data), # don't relabel reshaped cols
datasets = datasets,
anl_name = anl_name
)
```

For example AVAL_OS and AVAL_PFS should not be relabelled by column label but by factor level of variable which spreads data (eg PARAM). Optimally if possible should be in one rtables::relabel call but sepatate call also allowed.

Provenance:
```
Creator: gogonzo
```

Contributor guide

Open the contributing guide

Research direction

Start in merge_datasets and trace get_relabel_cols and get_anl_relabel_call to understand how reshaped columns are excluded. Reproduce a spread by PARAM involving columns such as AVAL_OS and AVAL_PFS, then verify that spread columns use factor-level labels while other columns retain column-label relabeling, using rtables::relabel where appropriate.

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
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.