Skip to content

How to insert blank line after page_by row split label? #1075

@danielinteractive

Description

@danielinteractive

Hi,

small question on the layout, I am trying to get a blank line after the page split labels.

Consider this reprex:

lyt <- basic_table() %>%
  split_cols_by("ARM") %>%
  split_rows_by("RACE", page_by = TRUE, section_div = " ", split_fun = drop_split_levels) %>%
  split_rows_by("STRATA1", split_fun = drop_split_levels, section_div = " ") %>%
  analyze("AGE", mean, var_labels = "Age", format = "xx.xx")

tbl <- build_table(lyt, DM)
tbl

This gives me:

                            A: Drug X   B: Placebo   C: Combination
———————————————————————————————————————————————————————————————————
ASIAN                                                              
  A                                                                
    mean                      32.19       33.90          36.81     
                                                                   
  B                                                                
    mean                      34.12       31.62          34.73     
                                                                   
  C                                                                
    mean                      36.21       33.00          32.39     
                                                                   
BLACK OR AFRICAN AMERICAN                                          
  A                                                                
    mean                      31.50       28.57          33.62     
                                                                   
[etc.]

How can I get:

                            A: Drug X   B: Placebo   C: Combination
———————————————————————————————————————————————————————————————————
ASIAN     
                                                         
  A                                                                
    mean                      32.19       33.90          36.81     
                                                                   
  B                                                                
    mean                      34.12       31.62          34.73     
                                                                   
  C                                                                
    mean                      36.21       33.00          32.39     
                                                                   
BLACK OR AFRICAN AMERICAN                                          

  A                                                                
    mean                      31.50       28.57          33.62     
                                                                   
[etc.]

(note the blank lines after ASIAN and BLACK OR AFRICAN AMERICAN)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions