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

Create function to add an empty row #35

Open
mbcann01 opened this issue Nov 20, 2020 · 0 comments
Open

Create function to add an empty row #35

mbcann01 opened this issue Nov 20, 2020 · 0 comments

Comments

@mbcann01
Copy link
Member

mbcann01 commented Nov 20, 2020

Often, when I am building tables for reports, I want there to be an empty row in between variables. Currently, I can manually add an empty row with dplyr::add_row(). Here is an example from the Sun Study report:

# Add a blank line in between each classroom
table_ss_application <- table_ss_application %>% 
  add_row(Classroom = "", `Sunscreen Application Outcome` = "", 
          Baseline = "", Intervention = "",
          Randomization = "", Maintenance = "", .after = 5
  ) %>% 
  add_row(Classroom = "", `Sunscreen Application Outcome` = "", 
          Baseline = "", Intervention = "",
          Randomization = "", Maintenance = "", .after = 11
  ) %>% 
  add_row(Classroom = "", `Sunscreen Application Outcome` = "", 
          Baseline = "", Intervention = "",
          Randomization = "", Maintenance = "", .after = 17
  )

However, that is long and clunky, and you have to list every variable by name. I want to come up with something more generic I can use to quickly add empty rows.

Would be even better if it were possible to do this directly in flextable rather than in data frames.

@mbcann01 mbcann01 moved this to Todo in freqtables Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Develop Next
Development

No branches or pull requests

1 participant