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

Text misalignment after dynamically generating tables #196

Open
jcutlerbiostats opened this issue Jul 13, 2024 · 0 comments
Open

Text misalignment after dynamically generating tables #196

jcutlerbiostats opened this issue Jul 13, 2024 · 0 comments

Comments

@jcutlerbiostats
Copy link

jcutlerbiostats commented Jul 13, 2024

With the new RStudio IDE (2024-06 I think), quarto html output has issues when I print multiple tables in a tagList(). All text is misaligned (text starts all the way at the left side of the screen) after a code chunk where I have tables dynamically generated in a loop/map() and the map() output piped into a tagList() for display.

I re-downloaded the 2023-12 RStudio IDE and ran the same quarto document again and the text alignment issue went away.

The warning I noticed quarto was giving me when I saw this issue was this:

Warning: The computation used to determine source line information from the engine timed out.
Line number information will be unavailable and/or inaccurate.

My gt and gtsummary tables look better with the new RStudio btw. So props to you for that. But unfortunately this bug sort of forces me to go back to using an earlier RStudio (with not-as-pretty tables).

Here is an example of code that will cause loss of text alignment downstream of the code:

`

my_tibble %>% select(contains("_change")) %>% names() %>%
map(.f = function(outcome){
tags$div(

  tryCatch(
    MASS::rlm(
      formula(str_c(outcome," ~ encounters")),
      data = my_tibble
    ) %>% 
      tbl_regression() %>% modify_caption(caption = outcome) %>% 
      as_gt(),
    error = function(e) HTML("Singular fit (model failed) - Likely due to lack of data.")
  ),
  
  tags$br(),
  tags$br()
)

}) %>% tagList()

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant