pharmaverse / pharmaverse/rtables
Proposal for a new `label_fun` argument for split functions
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 260
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Hi @gmbecker ,
I’d like to propose adding a new argument (say, label_fun) to split_rows*() / split_cols*().
The idea would be to allow users to provide a function that changes/formats the levels of the split variable. For example, suppose we have a SEX variable in the dataset with levels MALE and FEMALE, but we want the split labels to appear as Male and Female instead.
With this argument, I could simply specify:
label_fun = junco::string_to_title
and that would be it. I think transformations like string_to_title() are very common when formatting labels, so this would be a convenient way to handle this without having to modify the dataset itself.
Please consider it. Thanks!
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
Locate the split_rows*() and split_cols*() entry points first, then trace how split-variable levels become displayed labels. The proposal is complete when a label_fun argument can format those labels, including MALE/FEMALE as Male/Female, without modifying the source dataset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100