Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a empty row between rows differentiated by key_cols #237

Open
huanlugwu opened this issue Dec 3, 2024 · 3 comments
Open

Add a empty row between rows differentiated by key_cols #237

huanlugwu opened this issue Dec 3, 2024 · 3 comments
Labels
enhancement New feature or request sme

Comments

@huanlugwu
Copy link

In order to distinguish rows in listing by key_cols variable by variable, it would be nice to have a empty row in between, there is an example:

library(rlistings)
adae <- ex_adae
lsting <- as_listing(
  df = adae,
  disp_cols = c("ARM", "AGE", "SEX", "RACE", "AEDECOD", "AESEV"),
  key_cols = c("USUBJID", "AETOXGR")
)
head(lsting, 15)

then we have:

Unique Subject Identifier   Analysis Toxicity Grade   Description of Planned Arm   Age   Sex             Race              Dictionary-Derived Term   Severity/Intensity
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  AB12345-BRA-1-id-134                 2                      A: Drug X            47     M              WHITE                  dcd A.1.1.1.2             MODERATE     
                                                              A: Drug X            47     M              WHITE                  dcd A.1.1.1.2             MODERATE     
                                       3                      A: Drug X            47     M              WHITE                  dcd B.2.1.2.1             MODERATE     
                                                              A: Drug X            47     M              WHITE                  dcd D.1.1.4.2             MODERATE     
  AB12345-BRA-1-id-141                 1                    C: Combination         35     F              WHITE                  dcd D.2.1.5.3               MILD       
                                                            C: Combination         35     F              WHITE                  dcd A.1.1.1.1               MILD       
                                                            C: Combination         35     F              WHITE                  dcd A.1.1.1.1               MILD       
                                       2                    C: Combination         35     F              WHITE                  dcd A.1.1.1.2             MODERATE     
                                       3                    C: Combination         35     F              WHITE                  dcd B.2.1.2.1             MODERATE     
                                       5                    C: Combination         35     F              WHITE                  dcd D.1.1.1.1              SEVERE      
  AB12345-BRA-1-id-236                 5                      B: Placebo           32     M    BLACK OR AFRICAN AMERICAN        dcd B.1.1.1.1              SEVERE      
                                                              B: Placebo           32     M    BLACK OR AFRICAN AMERICAN        dcd B.1.1.1.1              SEVERE      
                                                              B: Placebo           32     M    BLACK OR AFRICAN AMERICAN        dcd B.1.1.1.1              SEVERE      
  AB12345-BRA-1-id-265                 2                    C: Combination         25     M              WHITE                  dcd C.2.1.2.1             MODERATE     
                                       3                    C: Combination         25     M              WHITE                  dcd D.1.1.4.2             MODERATE     

It would truly be nice to have a row in between each person, be like:

Unique Subject Identifier   Analysis Toxicity Grade   Description of Planned Arm   Age   Sex             Race              Dictionary-Derived Term   Severity/Intensity
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
  AB12345-BRA-1-id-134                 2                      A: Drug X            47     M              WHITE                  dcd A.1.1.1.2             MODERATE     
                                                              A: Drug X            47     M              WHITE                  dcd A.1.1.1.2             MODERATE     
                                       3                      A: Drug X            47     M              WHITE                  dcd B.2.1.2.1             MODERATE     
                                                              A: Drug X            47     M              WHITE                  dcd D.1.1.4.2             MODERATE     
  
  AB12345-BRA-1-id-141                 1                    C: Combination         35     F              WHITE                  dcd D.2.1.5.3               MILD       
                                                            C: Combination         35     F              WHITE                  dcd A.1.1.1.1               MILD       
                                                            C: Combination         35     F              WHITE                  dcd A.1.1.1.1               MILD       
                                       2                    C: Combination         35     F              WHITE                  dcd A.1.1.1.2             MODERATE     
                                       3                    C: Combination         35     F              WHITE                  dcd B.2.1.2.1             MODERATE     
                                       5                    C: Combination         35     F              WHITE                  dcd D.1.1.1.1              SEVERE      
  
  AB12345-BRA-1-id-236                 5                      B: Placebo           32     M    BLACK OR AFRICAN AMERICAN        dcd B.1.1.1.1              SEVERE      
                                                              B: Placebo           32     M    BLACK OR AFRICAN AMERICAN        dcd B.1.1.1.1              SEVERE      
                                                              B: Placebo           32     M    BLACK OR AFRICAN AMERICAN        dcd B.1.1.1.1              SEVERE      
  
  AB12345-BRA-1-id-265                 2                    C: Combination         25     M              WHITE                  dcd C.2.1.2.1             MODERATE     
                                       3                    C: Combination         25     M              WHITE                  dcd D.1.1.4.2             MODERATE     

Thank you for looking into this!

@huanlugwu huanlugwu added the enhancement New feature or request label Dec 3, 2024
@shajoezhu
Copy link
Collaborator

Hi @huanlugwu , thanks for the great suggestion, is this something Sanofi uses for your templates?

please feel free to raise PRs, and contributing to the package :) would love to hear your thoughts, and making this a great tool for the community

@huanlugwu
Copy link
Author

Yes, Joe, a empty row as a divider would be really reader friendly.

@Melkiades Melkiades added the sme label Dec 4, 2024
@Melkiades
Copy link
Contributor

There is no option so far for this in {rlistings}. There is one in {rtables} called section_div. I would probably do it differently here but the option is not present. @khatril what do you think?

ofc feel free to try adding this with a dedicated PR ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sme
Projects
None yet
Development

No branches or pull requests

3 participants